8.11. Operator Numerical
-obj
- neg+obj
- pos~obj
- invert
8.11.1. About
Operator |
Method |
---|---|
|
|
|
|
|
|
8.11.2. Operator
operator.neg(obj)
- neg --obj
operator.pos(obj)
- pos -+obj
operator.invert(obj)
- invert -~obj
>>> import operator
>>> operator.neg(1)
-1
>>> operator.pos(1)
1
>>> operator.invert(1)
-2