فهرست منبع

fix a bug of `type.__class__`

blueloveTH 2 سال پیش
والد
کامیت
c3f10ae4d1
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      src/pocketpy.cpp

+ 1 - 1
src/pocketpy.cpp

@@ -1658,7 +1658,7 @@ void add_module_gc(VM* vm){
 void VM::post_init(){
 void VM::post_init(){
     init_builtins(this);
     init_builtins(this);
 
 
-    bind_property(_t(tp_object), "__class__", PK_LAMBDA(VAR(vm->_t(args[0]))));
+    bind_property(_t(tp_object), "__class__", PK_LAMBDA(vm->_t(args[0])));
     bind_property(_t(tp_type), "__base__", [](VM* vm, ArgsView args){
     bind_property(_t(tp_type), "__base__", [](VM* vm, ArgsView args){
         const PyTypeInfo& info = vm->_all_types[PK_OBJ_GET(Type, args[0])];
         const PyTypeInfo& info = vm->_all_types[PK_OBJ_GET(Type, args[0])];
         return info.base.index == -1 ? vm->None : vm->_all_types[info.base].obj;
         return info.base.index == -1 ? vm->None : vm->_all_types[info.base].obj;