summaryrefslogtreecommitdiffstatshomepage
path: root/py/objfun.h
diff options
context:
space:
mode:
Diffstat (limited to 'py/objfun.h')
-rw-r--r--py/objfun.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/py/objfun.h b/py/objfun.h
index b049e5c7e8..f607a5eb6f 100644
--- a/py/objfun.h
+++ b/py/objfun.h
@@ -30,10 +30,15 @@ typedef struct _mp_obj_fun_bc_t {
machine_uint_t n_pos_args : 16; // number of arguments this function takes
machine_uint_t n_kwonly_args : 16; // number of arguments this function takes
machine_uint_t n_def_args : 16; // number of default arguments
+ machine_uint_t has_def_kw_args : 1; // set if this function has default keyword args
machine_uint_t takes_var_args : 1; // set if this function takes variable args
machine_uint_t takes_kw_args : 1; // set if this function takes keyword args
const byte *bytecode; // bytecode for the function
qstr *args; // argument names (needed to resolve positional args passed as keywords)
- // values of default args (if any), plus a slot at the end for var args and/or kw args (if it takes them)
+ // the following extra_args array is allocated space to take (in order):
+ // - values of positional default args (if any)
+ // - a single slot for default kw args dict (if it has them)
+ // - a single slot for var args tuple (if it takes them)
+ // - a single slot for kw args dict (if it takes them)
mp_obj_t extra_args[];
} mp_obj_fun_bc_t;