@@ -857,13 +857,13 @@ mp_obj_t mp_load_attr(mp_obj_t base, qstr attr) {
857857// no attribute found, returns: dest[0] == MP_OBJ_NULL, dest[1] == MP_OBJ_NULL
858858// normal attribute found, returns: dest[0] == <attribute>, dest[1] == MP_OBJ_NULL
859859// method attribute found, returns: dest[0] == <method>, dest[1] == <self>
860- void mp_load_method_maybe (mp_obj_t base , qstr attr , mp_obj_t * dest ) {
860+ void mp_load_method_maybe (mp_obj_t obj , qstr attr , mp_obj_t * dest ) {
861861 // clear output to indicate no attribute/method found yet
862862 dest [0 ] = MP_OBJ_NULL ;
863863 dest [1 ] = MP_OBJ_NULL ;
864864
865865 // get the type
866- mp_obj_type_t * type = mp_obj_get_type (base );
866+ mp_obj_type_t * type = mp_obj_get_type (obj );
867867
868868 // look for built-in names
869869 if (0 ) {
@@ -875,11 +875,11 @@ void mp_load_method_maybe(mp_obj_t base, qstr attr, mp_obj_t *dest) {
875875
876876 } else if (attr == MP_QSTR___next__ && type -> iternext != NULL ) {
877877 dest [0 ] = (mp_obj_t )& mp_builtin_next_obj ;
878- dest [1 ] = base ;
878+ dest [1 ] = obj ;
879879
880880 } else if (type -> load_attr != NULL ) {
881881 // this type can do its own load, so call it
882- type -> load_attr (base , attr , dest );
882+ type -> load_attr (obj , attr , dest );
883883
884884 } else if (type -> locals_dict != NULL ) {
885885 // generic method lookup
@@ -896,14 +896,14 @@ void mp_load_method_maybe(mp_obj_t base, qstr attr, mp_obj_t *dest) {
896896 } else if (MP_OBJ_IS_TYPE (elem -> value , & mp_type_classmethod )) {
897897 // return a bound method, with self being the type of this object
898898 dest [0 ] = ((mp_obj_static_class_method_t * )elem -> value )-> fun ;
899- dest [1 ] = mp_obj_get_type ( base ) ;
899+ dest [1 ] = type ;
900900 } else if (MP_OBJ_IS_TYPE (elem -> value , & mp_type_type )) {
901901 // Don't try to bind types
902902 dest [0 ] = elem -> value ;
903903 } else if (mp_obj_is_callable (elem -> value )) {
904904 // return a bound method, with self being this object
905905 dest [0 ] = elem -> value ;
906- dest [1 ] = base ;
906+ dest [1 ] = obj ;
907907 } else {
908908 // class member is a value, so just return that value
909909 dest [0 ] = elem -> value ;
0 commit comments