diff options
author | Benjamin Peterson <benjamin@python.org> | 2013-02-10 09:29:59 -0500 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2013-02-10 09:29:59 -0500 |
commit | 3519d4fdaa0875b231d459d2bbe948aeb6761af3 (patch) | |
tree | 82b0ad83b9ec4227b2ad4c7e5571b7118afe5f2f /Python/compile.c | |
parent | 7510c5a18710c48769e9cffb481c00bbd6261124 (diff) | |
download | cpython-3519d4fdaa0875b231d459d2bbe948aeb6761af3.tar.gz |
evaluate positional defaults before keyword-only defaults (closes #16967)
Diffstat (limited to 'Python/compile.c')
-rw-r--r-- | Python/compile.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/compile.c b/Python/compile.c index 8f876a6d0d..a0df40c323 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -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; |