pocketpy/docs/modules/operator.md
2023-10-29 22:22:22 +08:00

14 lines
441 B
Markdown

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