ソースを参照

remove `operator` module

blueloveTH 1 年間 前
コミット
3278699d03
4 ファイル変更0 行追加26 行削除
  1. 0 14
      docs/modules/operator.md
  2. 0 1
      include/pocketpy/modules.h
  3. 0 10
      src/modules.cpp
  4. 0 1
      src/pocketpy.cpp

+ 0 - 14
docs/modules/operator.md

@@ -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)`

+ 0 - 1
include/pocketpy/modules.h

@@ -4,7 +4,6 @@
 
 namespace pkpy{
 
-void add_module_operator(VM* vm);
 void add_module_time(VM* vm);
 void add_module_sys(VM* vm);
 void add_module_json(VM* vm);

+ 0 - 10
src/modules.cpp

@@ -2,16 +2,6 @@
 
 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{
     int tm_year;
     int tm_mon;

+ 0 - 1
src/pocketpy.cpp

@@ -1611,7 +1611,6 @@ void VM::post_init(){
     add_module_gc(this);
     add_module_random(this);
     add_module_base64(this);
-    add_module_operator(this);
     
     _lazy_modules["this"] = kPythonLibs_this;
     _lazy_modules["functools"] = kPythonLibs_functools;