diff options
author | Damien George <damien.p.george@gmail.com> | 2014-03-26 23:09:14 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-03-26 23:09:14 +0000 |
commit | d6f94340916bc5eabcf51d7afea523885adce818 (patch) | |
tree | bc59b126181dcf37868b72f5edbb6e74c1b0c1f3 /py/compile.c | |
parent | eed6f26bed82969e3c9954159b17fe2733f4cb42 (diff) | |
parent | 2447a5b582503b70936681702062704e2e9f44d3 (diff) |
Merge pull request #381 from pfalcon/closure-defargs
py: Support closures with default args.
Diffstat (limited to 'py/compile.c')
-rw-r--r-- | py/compile.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/py/compile.c b/py/compile.c index 0a10b8176..dc001cd88 100644 --- a/py/compile.c +++ b/py/compile.c @@ -766,6 +766,9 @@ void c_assign(compiler_t *comp, mp_parse_node_t pn, assign_kind_t assign_kind) { // stuff for lambda and comprehensions and generators void close_over_variables_etc(compiler_t *comp, scope_t *this_scope, int n_dict_params, int n_default_params) { + if (n_default_params) { + EMIT_ARG(build_tuple, n_default_params); + } // make closed over variables, if any // ensure they are closed over in the order defined in the outer scope (mainly to agree with CPython) int nfree = 0; |