@@ -83,19 +83,18 @@ typedef mp_obj_t (*mp_fun_2_t)(mp_obj_t, mp_obj_t);
8383typedef mp_obj_t (* mp_fun_3_t )(mp_obj_t , mp_obj_t , mp_obj_t );
8484typedef mp_obj_t (* mp_fun_t )(void );
8585typedef mp_obj_t (* mp_fun_var_t )(int n , const mp_obj_t * );
86- typedef mp_obj_t (* mp_fun_kw_t )(mp_obj_t , struct _mp_map_t * );
86+ typedef mp_obj_t (* mp_fun_kw_t )(uint n , const mp_obj_t * , struct _mp_map_t * );
8787
8888typedef enum {
8989 PRINT_STR , PRINT_REPR
9090} mp_print_kind_t ;
9191
9292typedef void (* mp_print_fun_t )(void (* print )(void * env , const char * fmt , ...), void * env , mp_obj_t o , mp_print_kind_t kind );
93- typedef mp_obj_t (* mp_make_new_fun_t )(mp_obj_t type_in , int n_args , const mp_obj_t * args ); // args are in reverse order in the array
94- typedef mp_obj_t (* mp_call_n_fun_t )(mp_obj_t fun , int n_args , const mp_obj_t * args ); // args are in reverse order in the array
95- typedef mp_obj_t (* mp_call_n_kw_fun_t )(mp_obj_t fun , int n_args , int n_kw , const mp_obj_t * args ); // args are in reverse order in the array
93+ typedef mp_obj_t (* mp_make_new_fun_t )(mp_obj_t type_in , uint n_args , uint n_kw , const mp_obj_t * args );
94+ typedef mp_obj_t (* mp_call_fun_t )(mp_obj_t fun , uint n_args , uint n_kw , const mp_obj_t * args );
9695typedef mp_obj_t (* mp_unary_op_fun_t )(int op , mp_obj_t );
9796typedef mp_obj_t (* mp_binary_op_fun_t )(int op , mp_obj_t , mp_obj_t );
98- typedef void (* mp_load_attr_fun_t )(mp_obj_t self_in , qstr attr , mp_obj_t * dest ); // for fail, do nothing; for attr, dest[1 ] = value; for method, dest[0] = self , dest[1] = method
97+ typedef void (* mp_load_attr_fun_t )(mp_obj_t self_in , qstr attr , mp_obj_t * dest ); // for fail, do nothing; for attr, dest[0 ] = value; for method, dest[0] = method , dest[1] = self
9998typedef bool (* mp_store_attr_fun_t )(mp_obj_t self_in , qstr attr , mp_obj_t value ); // return true if store succeeded
10099
101100typedef struct _mp_method_t {
@@ -144,8 +143,7 @@ struct _mp_obj_type_t {
144143 mp_print_fun_t print ;
145144 mp_make_new_fun_t make_new ; // to make an instance of the type
146145
147- mp_call_n_fun_t call_n ;
148- mp_call_n_kw_fun_t call_n_kw ;
146+ mp_call_fun_t call ;
149147 mp_unary_op_fun_t unary_op ; // can return NULL if op not supported
150148 mp_binary_op_fun_t binary_op ; // can return NULL if op not supported
151149
@@ -222,13 +220,11 @@ mp_obj_t mp_obj_new_gen_wrap(uint n_locals, uint n_stack, mp_obj_t fun);
222220mp_obj_t mp_obj_new_gen_instance (const byte * bytecode , uint n_state , int n_args , const mp_obj_t * args );
223221mp_obj_t mp_obj_new_closure (mp_obj_t fun , mp_obj_t closure_tuple );
224222mp_obj_t mp_obj_new_tuple (uint n , const mp_obj_t * items );
225- mp_obj_t mp_obj_new_tuple_reverse (uint n , const mp_obj_t * items );
226223mp_obj_t mp_obj_new_list (uint n , mp_obj_t * items );
227- mp_obj_t mp_obj_new_list_reverse (uint n , mp_obj_t * items );
228224mp_obj_t mp_obj_new_dict (int n_args );
229225mp_obj_t mp_obj_new_set (int n_args , mp_obj_t * items );
230226mp_obj_t mp_obj_new_slice (mp_obj_t start , mp_obj_t stop , mp_obj_t step );
231- mp_obj_t mp_obj_new_bound_meth (mp_obj_t self , mp_obj_t meth );
227+ mp_obj_t mp_obj_new_bound_meth (mp_obj_t meth , mp_obj_t self );
232228mp_obj_t mp_obj_new_module (qstr module_name );
233229
234230mp_obj_t mp_obj_get_type (mp_obj_t o_in );
@@ -296,7 +292,7 @@ extern const mp_obj_type_t list_type;
296292mp_obj_t mp_obj_list_append (mp_obj_t self_in , mp_obj_t arg );
297293void mp_obj_list_get (mp_obj_t self_in , uint * len , mp_obj_t * * items );
298294void mp_obj_list_store (mp_obj_t self_in , mp_obj_t index , mp_obj_t value );
299- mp_obj_t mp_obj_list_sort (mp_obj_t args , struct _mp_map_t * kwargs );
295+ mp_obj_t mp_obj_list_sort (uint n_args , const mp_obj_t * args , struct _mp_map_t * kwargs );
300296
301297// map (the python builtin, not the dict implementation detail)
302298extern const mp_obj_type_t map_type ;
0 commit comments