Commit 7bccaf6
committed
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 c461aa9 commit 7bccaf6
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 | |
|---|---|---|---|
| |||
3236 | 3236 | | |
3237 | 3237 | | |
3238 | 3238 | | |
| 3239 | + | |
| 3240 | + | |
| 3241 | + | |
| 3242 | + | |
| 3243 | + | |
| 3244 | + | |
| 3245 | + | |
| 3246 | + | |
| 3247 | + | |
| 3248 | + | |
| 3249 | + | |
| 3250 | + | |
| 3251 | + | |
| 3252 | + | |
| 3253 | + | |
3239 | 3254 | | |
3240 | 3255 | | |
3241 | 3256 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7204 | 7204 | | |
7205 | 7205 | | |
7206 | 7206 | | |
| 7207 | + | |
| 7208 | + | |
| 7209 | + | |
| 7210 | + | |
| 7211 | + | |
| 7212 | + | |
| 7213 | + | |
7207 | 7214 | | |
7208 | 7215 | | |
7209 | 7216 | | |
| |||
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 | |
|---|---|---|---|
| |||
1093 | 1093 | | |
1094 | 1094 | | |
1095 | 1095 | | |
1096 | | - | |
| 1096 | + | |
1097 | 1097 | | |
1098 | 1098 | | |
1099 | | - | |
| 1099 | + | |
1100 | 1100 | | |
1101 | 1101 | | |
1102 | 1102 | | |
| |||
0 commit comments