mirror of
https://github.com/python/cpython.git
synced 2025-09-05 00:11:10 +00:00
evaluate positional defaults before keyword-only defaults (closes #16967)
This commit is contained in:
parent
34a2a87d17
commit
1ef876cd28
7 changed files with 161 additions and 147 deletions
|
@ -1565,6 +1565,8 @@ compiler_function(struct compiler *c, stmt_ty s)
|
|||
|
||||
if (!compiler_decorators(c, decos))
|
||||
return 0;
|
||||
if (args->defaults)
|
||||
VISIT_SEQ(c, expr, args->defaults);
|
||||
if (args->kwonlyargs) {
|
||||
int res = compiler_visit_kwonlydefaults(c, args->kwonlyargs,
|
||||
args->kw_defaults);
|
||||
|
@ -1572,8 +1574,6 @@ compiler_function(struct compiler *c, stmt_ty s)
|
|||
return 0;
|
||||
kw_default_count = res;
|
||||
}
|
||||
if (args->defaults)
|
||||
VISIT_SEQ(c, expr, args->defaults);
|
||||
num_annotations = compiler_visit_annotations(c, args, returns);
|
||||
if (num_annotations < 0)
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue