PyDocs

Functional Programming Modules

Functional Programming Modules

operator

Operator interface.

This module exports a set of functions implemented in C corresponding
to the intrinsic operators of Python.  For example, operator.add(x, y)
is equivalent to the expression x+y.  The function names are those
used for special methods; variants without leading and trailing
'__' are also provided for convenience.
Symbols in operator

_

__abs__
Same as abs(a).
__add__
Same as a + b.
__and__
Same as a & b.
__call__
Same as obj(*args, **kwargs).
__concat__
Same as a + b, for a and b sequences.
__contains__
Same as b in a (note reversed operands).
__delitem__
Same as del a[b].
__eq__
Same as a == b.
__floordiv__
Same as a // b.
__ge__
Same as a >= b.
__getitem__
Same as a[b].
__gt__
Same as a > b.
__iadd__
Same as a += b.
__iand__
Same as a &= b.
__iconcat__
Same as a += b, for a and b sequences.
__ifloordiv__
Same as a //= b.
__ilshift__
Same as a <<= b.
__imatmul__
Same as a @= b.
__imod__
Same as a %= b.
__imul__
Same as a *= b.
__index__
Same as a.__index__()
__inv__
Same as ~a.
__invert__
Same as ~a.
__ior__
Same as a |= b.
__ipow__
Same as a **= b.
__irshift__
Same as a >>= b.
__isub__
Same as a -= b.
__itruediv__
Same as a /= b.
__ixor__
Same as a ^= b.
__le__
Same as a <= b.
__lshift__
Same as a << b.
__lt__
Same as a < b.
__matmul__
Same as a @ b.
__mod__
Same as a % b.
__mul__
Same as a * b.
__ne__
Same as a != b.
__neg__
Same as -a.
__not__
Same as not a.
__or__
Same as a | b.
__pos__
Same as +a.
__pow__
Same as a ** b.
__rshift__
Same as a >> b.
__setitem__
Same as a[b] = c.
__sub__
Same as a - b.
__truediv__
Same as a / b.
__xor__
Same as a ^ b.

a

abs
Same as abs(a).
add
Same as a + b.
and_
Same as a & b.
attrgetter
Return a callable object that fetches the given attribute(s) from its operand.

c

call
Same as obj(*args, **kwargs).
concat
Same as a + b, for a and b sequences.
contains
Same as b in a (note reversed operands).
countOf
Return the number of items in a which are, or which equal, b.

d

delitem
Same as del a[b].

e

eq
Same as a == b.

f

floordiv
Same as a // b.

g

ge
Same as a >= b.
getitem
Same as a[b].
gt
Same as a > b.

i

iadd
Same as a += b.
iand
Same as a &= b.
iconcat
Same as a += b, for a and b sequences.
ifloordiv
Same as a //= b.
ilshift
Same as a <<= b.
imatmul
Same as a @= b.
imod
Same as a %= b.
imul
Same as a *= b.
index
Same as a.__index__()
indexOf
Return the first index of b in a.
inv
Same as ~a.
invert
Same as ~a.
ior
Same as a |= b.
ipow
Same as a **= b.
irshift
Same as a >>= b.
is_
Same as a is b.
is_none
Same as a is None.
is_not
Same as a is not b.
is_not_none
Same as a is not None.
isub
Same as a -= b.
itemgetter
Return a callable object that fetches the given item(s) from its operand.
itruediv
Same as a /= b.
ixor
Same as a ^= b.

l

le
Same as a <= b.
length_hint
Return an estimate of the number of items in obj.
lshift
Same as a << b.
lt
Same as a < b.

m

matmul
Same as a @ b.
methodcaller
Return a callable object that calls the given method on its operand.
mod
Same as a % b.
mul
Same as a * b.

n

ne
Same as a != b.
neg
Same as -a.
not_
Same as not a.

o

or_
Same as a | b.

p

pos
Same as +a.
pow
Same as a ** b.

r

rshift
Same as a >> b.

s

setitem
Same as a[b] = c.
sub
Same as a - b.

t

truediv
Same as a / b.
truth
Return True if a is true, False otherwise.

x

xor
Same as a ^ b.