On this page
operator.inv
Prev: operator.indexOf | Up: operator | Next: operator.invert
Rel: operator.abs, operator.add, operator.and_, operator.attrgetter
Ref: docs.python.org — operator.inv
Tags: #public #python3 #stdlib #operator
Import
import operator
from operator import inv
Signature & Overview
operator.inv(a, /)
Same as ~a.
Usage
import operator
assert operator.inv(0) == -1 and operator.inv is operator.invert
Gotchas
- Bitwise
~a(alias foroperator.invert).
REPL Inspect
from operator import inv
help(inv)
Linked from
Related notes
- tuts/python3/stdlib_module/operator/indexOf Linked here; links to this page; shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator/invert Linked here; links to this page; shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/operator/abs Linked here; shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator/add Linked here; shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator/and_ Linked here; shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator/attrgetter Linked here; shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator/call shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator/concat shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator/contains shared tags: #operator, #stdlib