numbers.Integral

class numbers.Integral[source]

Integral adds a conversion to long and the bit-string operations.

Methods

__abs__() Returns the Real distance from 0.
__add__(other) self + other
__and__(other) self & other
__complex__(self) == complex(float(self), 0)
__div__(other) self / other without __future__ division
__divmod__(other) divmod(self, other): The pair (self // other, self % other).
__eq__(other) self == other
__float__(self) == float(long(self))
__floordiv__(other) self // other: The floor() of self/other.
__format__ default object formatter
__index__() Called whenever an index is needed, such as in slicing
__invert__() ~self
__le__(other) self <= other
__long__(self)
__lshift__(other) self << other
__lt__(other) self < other
__mod__(other) self % other
__mul__(other) self * other
__ne__(other) self != other
__neg__() -self
__new__((S, ...)
__nonzero__() True if self != 0.
__or__(other) self | other
__pos__() +self
__pow__(exponent[, modulus]) self ** exponent % modulus, but maybe faster.
__radd__(other) other + self
__rand__(other) other & self
__rdiv__(other) other / self without __future__ division
__rdivmod__(other) divmod(other, self): The pair (self // other, self % other).
__reduce__ helper for pickle
__reduce_ex__ helper for pickle
__rfloordiv__(other) other // self: The floor() of other/self.
__rlshift__(other) other << self
__rmod__(other) other % self
__rmul__(other) other * self
__ror__(other) other | self
__rpow__(base) base ** self
__rrshift__(other) other >> self
__rshift__(other) self >> other
__rsub__(other) other - self
__rtruediv__(other) other / self with __future__ division
__rxor__(other) other ^ self
__sizeof__(() -> int) size of object in memory, in bytes
__sub__(other) self - other
__subclasshook__ Abstract classes can override this to customize issubclass().
__truediv__(other) self / other with __future__ division.
__trunc__() trunc(self): Truncates self to an Integral.
__xor__(other) self ^ other
conjugate() Conjugate is a no-op for Reals.

Attributes

denominator Integers have a denominator of 1.
imag Real numbers have no imaginary component.
numerator Integers are their own numerators.
real Real numbers are their real component.