5.5 Unary arithmetic operations
All unary arithmetic (and bit-wise) operations have the same priority:
- (minus) operator yields the negation of its
+ (plus) operator yields its numeric argument
~ (invert) operator yields the bit-wise inversion
of its plain or long integer argument. The bit-wise inversion of
x is defined as
-(x+1). It only applies to integral
In all three cases, if the argument does not have the proper type,
a TypeError exception is raised.
See About this document... for information on suggesting changes.