mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 03:20:18 +00:00
remove operator
module
This commit is contained in:
parent
022e9c53fb
commit
3278699d03
@ -1,14 +0,0 @@
|
|||||||
---
|
|
||||||
icon: package
|
|
||||||
label: operator
|
|
||||||
---
|
|
||||||
|
|
||||||
The operator module exports a set of efficient functions corresponding to the intrinsic operators of Python. For example, `operator.add(x, y)` is equivalent to the expression `x+y`.
|
|
||||||
Many function names are those used for special methods, without the double underscores.
|
|
||||||
|
|
||||||
+ `operator.lt(a, b)`
|
|
||||||
+ `operator.le(a, b)`
|
|
||||||
+ `operator.eq(a, b)`
|
|
||||||
+ `operator.ne(a, b)`
|
|
||||||
+ `operator.ge(a, b)`
|
|
||||||
+ `operator.gt(a, b)`
|
|
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
namespace pkpy{
|
namespace pkpy{
|
||||||
|
|
||||||
void add_module_operator(VM* vm);
|
|
||||||
void add_module_time(VM* vm);
|
void add_module_time(VM* vm);
|
||||||
void add_module_sys(VM* vm);
|
void add_module_sys(VM* vm);
|
||||||
void add_module_json(VM* vm);
|
void add_module_json(VM* vm);
|
||||||
|
@ -2,16 +2,6 @@
|
|||||||
|
|
||||||
namespace pkpy{
|
namespace pkpy{
|
||||||
|
|
||||||
void add_module_operator(VM* vm){
|
|
||||||
PyObject* mod = vm->new_module("operator");
|
|
||||||
vm->bind_func<2>(mod, "lt", [](VM* vm, ArgsView args) { return VAR(vm->py_lt(args[0], args[1]));});
|
|
||||||
vm->bind_func<2>(mod, "le", [](VM* vm, ArgsView args) { return VAR(vm->py_le(args[0], args[1]));});
|
|
||||||
vm->bind_func<2>(mod, "eq", [](VM* vm, ArgsView args) { return VAR(vm->py_eq(args[0], args[1]));});
|
|
||||||
vm->bind_func<2>(mod, "ne", [](VM* vm, ArgsView args) { return VAR(vm->py_ne(args[0], args[1]));});
|
|
||||||
vm->bind_func<2>(mod, "ge", [](VM* vm, ArgsView args) { return VAR(vm->py_ge(args[0], args[1]));});
|
|
||||||
vm->bind_func<2>(mod, "gt", [](VM* vm, ArgsView args) { return VAR(vm->py_gt(args[0], args[1]));});
|
|
||||||
}
|
|
||||||
|
|
||||||
struct PyStructTime{
|
struct PyStructTime{
|
||||||
int tm_year;
|
int tm_year;
|
||||||
int tm_mon;
|
int tm_mon;
|
||||||
|
@ -1611,7 +1611,6 @@ void VM::post_init(){
|
|||||||
add_module_gc(this);
|
add_module_gc(this);
|
||||||
add_module_random(this);
|
add_module_random(this);
|
||||||
add_module_base64(this);
|
add_module_base64(this);
|
||||||
add_module_operator(this);
|
|
||||||
|
|
||||||
_lazy_modules["this"] = kPythonLibs_this;
|
_lazy_modules["this"] = kPythonLibs_this;
|
||||||
_lazy_modules["functools"] = kPythonLibs_functools;
|
_lazy_modules["functools"] = kPythonLibs_functools;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user