mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-22 12:30:19 +00:00
...
This commit is contained in:
parent
08a8a2f252
commit
c1b2e3e52b
8
src/vm.h
8
src/vm.h
@ -230,10 +230,12 @@ public:
|
|||||||
return call_method(self, callable, args...);
|
return call_method(self, callable, args...);
|
||||||
}
|
}
|
||||||
|
|
||||||
PyObject* property(NativeFuncC fget){
|
PyObject* property(NativeFuncC fget, NativeFuncC fset=nullptr){
|
||||||
PyObject* p = builtins->attr("property");
|
PyObject* p = builtins->attr("property");
|
||||||
PyObject* method = heap.gcnew(tp_native_func, NativeFunc(fget, 1, false));
|
PyObject* _0 = heap.gcnew(tp_native_func, NativeFunc(fget, 1, false));
|
||||||
return call(p, method);
|
PyObject* _1 = vm->None;
|
||||||
|
if(fset != nullptr) _1 = heap.gcnew(tp_native_func, NativeFunc(fset, 2, false));
|
||||||
|
return call(p, _0, _1);
|
||||||
}
|
}
|
||||||
|
|
||||||
PyObject* new_type_object(PyObject* mod, StrName name, Type base){
|
PyObject* new_type_object(PyObject* mod, StrName name, Type base){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user