PyDocs

Nav

Python Runtime Services

object.__index__

builtins

method of object
  • object.__index__(self)
Called to implement operator.index(), and whenever Python needs to losslessly convert the numeric object to an integer object (such as in slicing, or in the built-in bin(), hex() and oct() functions). Presence of this method indicates that the numeric object is an integer type. Must return an integer.
0 Examples
No examples for builtins/object.__index__.
See Also
No see-alsos for builtins/object.__index__
0 Notes
No notes for object.__index__