mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 03:20:18 +00:00
...
This commit is contained in:
parent
e5fb7a65ff
commit
834e3f3e71
@ -200,10 +200,9 @@ inline void init_builtins(VM* _vm) {
|
||||
});
|
||||
|
||||
_vm->bind__repr__(_vm->tp_object, [](VM* vm, PyObject* obj) {
|
||||
PyObject* self = obj;
|
||||
if(is_tagged(obj)) self = nullptr;
|
||||
if(is_tagged(obj)) FATAL_ERROR();
|
||||
std::stringstream ss;
|
||||
ss << "<" << OBJ_NAME(vm->_t(self)) << " object at " << std::hex << self << ">";
|
||||
ss << "<" << OBJ_NAME(vm->_t(obj)) << " object at " << std::hex << obj << ">";
|
||||
return VAR(ss.str());
|
||||
});
|
||||
|
||||
|
3
src/vm.h
3
src/vm.h
@ -340,9 +340,8 @@ public:
|
||||
|
||||
#define BIND_UNARY_SPECIAL(name) \
|
||||
void bind##name(Type type, PyObject* (*f)(VM* vm, PyObject*)){ \
|
||||
PyObject* obj = _t(type); \
|
||||
_all_types[type].m##name = f; \
|
||||
bind_method<0>(obj, #name, [](VM* vm, ArgsView args){ \
|
||||
bind_method<0>(_t(type), #name, [](VM* vm, ArgsView args){ \
|
||||
return vm->_inst_type_info(args[0])->m##name(vm, args[0]); \
|
||||
}); \
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user