Commit cb339d3
authored
Ensure function annotations are returned in order of definition
Previously, when getting type annotations of a function, normal
arguments were returned before positional-only ones in the dictionary.
Since `functools.singledispatch` relies on this ordering being correct
to dispatch based on the type of the first argument, this issue was
causing incorrect registrations for functions with positional-only
arguments.
This commit updates how annotations are generated so that
positional-only arguments are generated and added to the dictionary
before normal arguments.
1 parent ab45919 commit cb339d3
File tree
4 files changed
+27
-2
lines changed- Lib/test
- Misc/NEWS.d/next/Core_and_Builtins
- Python
4 files changed
+27
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3358 | 3358 | | |
3359 | 3359 | | |
3360 | 3360 | | |
| 3361 | + | |
| 3362 | + | |
| 3363 | + | |
| 3364 | + | |
| 3365 | + | |
| 3366 | + | |
| 3367 | + | |
| 3368 | + | |
| 3369 | + | |
| 3370 | + | |
| 3371 | + | |
| 3372 | + | |
| 3373 | + | |
| 3374 | + | |
| 3375 | + | |
3361 | 3376 | | |
3362 | 3377 | | |
3363 | 3378 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7269 | 7269 | | |
7270 | 7270 | | |
7271 | 7271 | | |
| 7272 | + | |
| 7273 | + | |
| 7274 | + | |
| 7275 | + | |
| 7276 | + | |
| 7277 | + | |
| 7278 | + | |
7272 | 7279 | | |
7273 | 7280 | | |
7274 | 7281 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1130 | 1130 | | |
1131 | 1131 | | |
1132 | 1132 | | |
1133 | | - | |
| 1133 | + | |
1134 | 1134 | | |
1135 | 1135 | | |
1136 | | - | |
| 1136 | + | |
1137 | 1137 | | |
1138 | 1138 | | |
1139 | 1139 | | |
| |||
0 commit comments