Python's operator module in TypeScript
- abs
- add
- and_
- concat
- contains
- countOf
- eq
- floordiv
- ge
- getitem
- gt
- indexOf
- inv
- invert
- is_
- is_not
- le
- lshift
- lt
- mod
- mul
- ne
- neg
- not_
- or_
- pos
- pow
- rshift
- sub
- truediv
- truth
- xor
Help us add more
Got a rainy Sunday afternoon and a taste for a porting puzzle?
- Get inspiration from the Python 3 standard library string page.
- Click "New file" in the appropriate folder on GitHub. This will fork the project to your account, directly add the file to it, and send a Pull Request to us.
We will then review it. If it's useful to the project and in line with our contributing guidelines your work will become part of Locutus and you'll be automatically credited in the authors section accordingly.
Upstream Surface Inventory 32/55 shipped • 2 next 58%
Namespace-level inventory for Python 3.12: what we already ship, what we may still want,
and what we intentionally skip or keep.
operator
94%
shipped
32/34 shipped
2 next
21 explicit non-goals
Shipped (32)
Next
First-class operator helpers are strong plain-value portability targets.
indexmatmul
Explicit non-goals (21)
-
attrgetterGetter factories return callable objects rather than plain values. -
callIndirect call wrappers add little value beyond direct JS invocation. -
delitemContainer mutation is outside Locutus' value-only model. -
iaddIn-place operator wrappers imply mutation semantics. -
iandIn-place operator wrappers imply mutation semantics. -
iconcatIn-place operator wrappers imply mutation semantics. -
ifloordivIn-place operator wrappers imply mutation semantics. -
ilshiftIn-place operator wrappers imply mutation semantics. -
imatmulIn-place operator wrappers imply mutation semantics. -
imodIn-place operator wrappers imply mutation semantics. -
imulIn-place operator wrappers imply mutation semantics. -
iorIn-place operator wrappers imply mutation semantics. -
ipowIn-place operator wrappers imply mutation semantics. -
irshiftIn-place operator wrappers imply mutation semantics. -
isubIn-place operator wrappers imply mutation semantics. -
itemgetterGetter factories return callable objects rather than plain values. -
itruedivIn-place operator wrappers imply mutation semantics. -
ixorIn-place operator wrappers imply mutation semantics. -
length_hintSize-hint probing adds little value beyond direct JS length checks. -
methodcallerMethod-caller factories return callable objects rather than plain values. -
setitemContainer mutation is outside Locutus' value-only model.