diff options
| author | Damien George <damien.p.george@gmail.com> | 2014-04-11 13:38:30 +0000 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2014-04-11 13:38:30 +0000 |
| commit | 69b89d21b2dcbe61c9abe1744cc0ec77d89422de (patch) | |
| tree | bb467f417445eef1af49054d2a5363044380505b /py/objfun.c | |
| parent | 0e3329a6b82873531f63fb1358f57852723fad05 (diff) | |
py: Change compile order for default positional and keyword args.
This simplifies the compiler a little, since now it can do 1 pass over
a function declaration, to determine default arguments. I would have
done this originally, but CPython 3.3 somehow had the default keyword
args compiled before the default position args (even though they appear
in the other order in the text of the script), and I thought it was
important to have the same order of execution when evaluating default
arguments. CPython 3.4 has changed the order to the more obvious one,
so we can also change.
Diffstat (limited to 'py/objfun.c')
| -rw-r--r-- | py/objfun.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/py/objfun.c b/py/objfun.c index adf05ce40..dd4b7347c 100644 --- a/py/objfun.c +++ b/py/objfun.c @@ -361,6 +361,7 @@ mp_obj_t mp_obj_new_fun_bc(uint scope_flags, qstr *args, uint n_args, mp_obj_t d uint n_extra_args = 0; mp_obj_tuple_t *def_args = def_args_in; if (def_args != MP_OBJ_NULL) { + assert(MP_OBJ_IS_TYPE(def_args, &mp_type_tuple)); n_def_args = def_args->len; n_extra_args = def_args->len; } |
