On this page
operator.abs
Up: operator | Next: operator.add
Rel: operator.add, operator.and_, operator.attrgetter, operator.call
Ref: docs.python.org — operator.abs
Tags: #public #python3 #stdlib #operator
Import
import operator
from operator import abs
Signature & Overview
operator.abs(a, /)
Same as abs(a).
Usage
import operator
assert operator.abs(-9) == 9
Gotchas
- Functional form of
abs(a): Handy withmap(operator.abs, nums).
REPL Inspect
from operator import abs
help(abs)
Linked from
- tuts/python3/stdlib_module/operator
- tuts/python3/stdlib_module/operator/add
- tuts/python3/stdlib_module/operator/and_
- tuts/python3/stdlib_module/operator/attrgetter
- tuts/python3/stdlib_module/operator/call
- tuts/python3/stdlib_module/operator/concat
- tuts/python3/stdlib_module/operator/contains
- tuts/python3/stdlib_module/operator/countOf
- tuts/python3/stdlib_module/operator/delitem
- tuts/python3/stdlib_module/operator/eq
- tuts/python3/stdlib_module/operator/floordiv
- tuts/python3/stdlib_module/operator/ge
- tuts/python3/stdlib_module/operator/getitem
- tuts/python3/stdlib_module/operator/gt
- tuts/python3/stdlib_module/operator/iadd
- tuts/python3/stdlib_module/operator/iand
- tuts/python3/stdlib_module/operator/iconcat
- tuts/python3/stdlib_module/operator/ifloordiv
- tuts/python3/stdlib_module/operator/ilshift
- tuts/python3/stdlib_module/operator/imatmul
- tuts/python3/stdlib_module/operator/imod
- tuts/python3/stdlib_module/operator/imul
- tuts/python3/stdlib_module/operator/index
- tuts/python3/stdlib_module/operator/indexOf
- tuts/python3/stdlib_module/operator/inv
- tuts/python3/stdlib_module/operator/invert
- tuts/python3/stdlib_module/operator/ior
- tuts/python3/stdlib_module/operator/ipow
- tuts/python3/stdlib_module/operator/irshift
- tuts/python3/stdlib_module/operator/is_
- tuts/python3/stdlib_module/operator/is_none
- tuts/python3/stdlib_module/operator/is_not
- tuts/python3/stdlib_module/operator/is_not_none
- tuts/python3/stdlib_module/operator/isub
- tuts/python3/stdlib_module/operator/itemgetter
- tuts/python3/stdlib_module/operator/itruediv
- tuts/python3/stdlib_module/operator/ixor
- tuts/python3/stdlib_module/operator/methodcaller
Related notes
- tuts/python3/stdlib_module/operator/add Linked here; links to this page; shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator/and_ Linked here; links to this page; shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator/attrgetter Linked here; links to this page; shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator/call 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/concat links to this page; shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator/contains links to this page; shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator/countOf links to this page; shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator/delitem links to this page; shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator/eq links to this page; shared tags: #operator, #stdlib