
Built-in Functions
|
67
__complex__(self)
Invoked on complex(self).
__int__(self)
Invoked on int(self).
__long__(self)
Invoked on long(self).
__float__(self)
Invoked on float(self).
__oct__(self)
Invoked on oct(self). This method returns an octal
string representation.
__hex__(self)
Invoked on hex(self). This method returns a hex string
representation.
__nonzero__(self)
Invoked on truth-value (otherwise, uses __len__ if
defined).
__coerce__(self, other)
Invoked on the mixed-mode arithmetic expression,
coerce(). This method returns a tuple of (self, other)
converted to a common type. If __coerce__ is defined, it
is generally called before any real operator methods are
tried (e.g., before
__add__). It should return a tuple con-
taining operands converted to a common type (or
None if
it can’t convert). See the Python Language Reference
(http://www.python.org/doc/) for more on coercion rules.
Built-in Functions
All built-in names (functions, exceptions, and so on) exist
in the implied outer built-in scope, which corresponds to
the
__builtin__ module. Because this scope is always
searched last on name lookups, these functions are always