Commit d86bc2c
authored
Fix
We have `**kwargs: Optional[Dict[str, Any]]` in a few places in our
codebase. This is actually means "each kwarg is of type
`Optional[Dict[str, Any]]`. The right thing to do is `**kwargs: Any`.
Once our minimum supported Python version is 3.11, we will be able to
have more precise type hints for `**kwargs`.
https://typing.python.org/en/latest/spec/callables.html#unpack-kwargs
Before the change (with Pylance typeChecking set to "standard"):
<img width="800" height="144" alt="image"
src="https://github.com/user-attachments/assets/9006e127-211f-4112-bedb-92a17f012063"
/>
After the change (with Pylance typeChecking set to "standard"):
<img width="1225" height="222" alt="image"
src="https://github.com/user-attachments/assets/9a89f11f-7e98-4f52-a897-b39c645ead61"
/>**kwargs typehints (#2884)1 parent dc87380 commit d86bc2c
File tree
4 files changed
+6
-6
lines changed- source/pip/qsharp/openqasm
4 files changed
+6
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
| 24 | + | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
| 25 | + | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
0 commit comments