Name
__abs__, __invert__, __neg__, __pos__
Synopsis
__abs__(self) __invert__(self) __neg__(self) __pos__(self)
Unary operators
abs(
x
)
,
~
x
,
-
x
, and
+
x
, respectively, call
these methods.
Get Python in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.