diff options
author | Damien George <damien.p.george@gmail.com> | 2014-01-09 21:43:51 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-01-09 21:43:51 +0000 |
commit | 004cdcebfe03d52ca9da3b2515c203910502dbba (patch) | |
tree | d4e36873836f0eee94d606f8ca87a246ea668ccc /py/obj.h | |
parent | 062478e66d03cc59ed73484a3032ef5f08db12a4 (diff) |
py: Implement base class lookup, issubclass, isinstance.
Diffstat (limited to 'py/obj.h')
-rw-r--r-- | py/obj.h | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -147,7 +147,10 @@ struct _mp_obj_type_t { mp_load_attr_fun_t load_attr; mp_store_attr_fun_t store_attr; - mp_obj_t locals; + + // these are for dynamically created types (classes) + mp_obj_t bases_tuple; + mp_obj_t locals_dict; /* What we might need to add here: @@ -180,7 +183,7 @@ extern const mp_obj_t mp_const_stop_iteration; // special object indicating end // General API for objects -mp_obj_t mp_obj_new_type(qstr name, mp_obj_t local_dict); +mp_obj_t mp_obj_new_type(qstr name, mp_obj_t bases_tuple, mp_obj_t locals_dict); mp_obj_t mp_obj_new_none(void); mp_obj_t mp_obj_new_bool(bool value); mp_obj_t mp_obj_new_cell(mp_obj_t obj); @@ -308,9 +311,6 @@ void mp_obj_fun_bc_get(mp_obj_t self_in, int *n_args, uint *n_state, const byte // generator extern const mp_obj_type_t gen_instance_type; -// class -struct _mp_map_elem_t *mp_obj_class_lookup(mp_obj_t self_in, qstr attr, enum _mp_map_lookup_kind_t lookup_kind); - // module extern const mp_obj_type_t module_type; mp_obj_t mp_obj_new_module(qstr module_name); |