mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-21 03:50:16 +00:00
Update pocketpy.h
This commit is contained in:
parent
e421a06923
commit
cd6484a61a
@ -520,20 +520,15 @@ void add_module_time(VM* vm){
|
||||
|
||||
void add_module_sys(VM* vm){
|
||||
PyVar mod = vm->new_module("sys");
|
||||
vm->bind_func<1>(mod, "getrefcount", [](VM* vm, const pkpy::Args& args) {
|
||||
return vm->PyInt(args[0].use_count());
|
||||
});
|
||||
vm->setattr(mod, "version", vm->PyStr(PK_VERSION));
|
||||
|
||||
vm->bind_func<0>(mod, "getrecursionlimit", [](VM* vm, const pkpy::Args& args) {
|
||||
return vm->PyInt(vm->maxRecursionDepth);
|
||||
});
|
||||
vm->bind_func<1>(mod, "getrefcount", CPP_LAMBDA(vm->PyInt(args[0].use_count())));
|
||||
vm->bind_func<0>(mod, "getrecursionlimit", CPP_LAMBDA(vm->PyInt(vm->maxRecursionDepth)));
|
||||
|
||||
vm->bind_func<1>(mod, "setrecursionlimit", [](VM* vm, const pkpy::Args& args) {
|
||||
vm->maxRecursionDepth = (int)vm->PyInt_AS_C(args[0]);
|
||||
return vm->None;
|
||||
});
|
||||
|
||||
vm->setattr(mod, "version", vm->PyStr(PK_VERSION));
|
||||
}
|
||||
|
||||
void add_module_json(VM* vm){
|
||||
|
Loading…
x
Reference in New Issue
Block a user