@@ -636,44 +636,17 @@ struct _mp_obj_type_t {
636
636
struct _mp_obj_type_ext ext [];
637
637
};
638
638
639
+ // _mp_obj_full_type_t must match _mp_obj_type_t exactly, except that the `ext` field
640
+ // is a 1-element array rather than a flexible array member.
639
641
struct _mp_obj_full_type_t {
640
- // A type is an object so must start with this entry, which points to mp_type_type.
641
642
mp_obj_base_t base ;
642
-
643
- // Flags associated with this type.
644
643
uint16_t flags ;
645
-
646
- // The name of this type, a qstr.
647
644
uint16_t name ;
648
-
649
- // A dict mapping qstrs to objects local methods/constants/etc.
650
645
struct _mp_obj_dict_t * locals_dict ;
651
-
652
- // Corresponds to __new__ and __init__ special methods, to make an instance of the type.
653
646
mp_make_new_fun_t make_new ;
654
-
655
- // Corresponds to __repr__ and __str__ special methods.
656
647
mp_print_fun_t print ;
657
-
658
- // Implements load, store and delete attribute.
659
- //
660
- // dest[0] = MP_OBJ_NULL means load
661
- // return: for fail, do nothing
662
- // for attr, dest[0] = value
663
- // for method, dest[0] = method, dest[1] = self
664
- //
665
- // dest[0,1] = {MP_OBJ_SENTINEL, MP_OBJ_NULL} means delete
666
- // dest[0,1] = {MP_OBJ_SENTINEL, object} means store
667
- // return: for fail, do nothing
668
- // for success set dest[0] = MP_OBJ_NULL
669
648
mp_attr_fun_t attr ;
670
-
671
- // A pointer to the parents of this type:
672
- // - 0 parents: pointer is NULL (object is implicitly the single parent)
673
- // - 1 parent: a pointer to the type of that parent
674
- // - 2 or more parents: pointer to a tuple object containing the parent types
675
649
const void * parent ;
676
-
677
650
struct _mp_obj_type_ext ext [1 ];
678
651
};
679
652
0 commit comments