On 4 Apr 2013 00:18, "Barry Warsaw" <[email protected]
<mailto:[email protected]>> wrote:
__index__() is a bit trickier because it is not tied directly to type
conversion. In this case, int subclasses could be valid, and as Hrvoje later
points out, returning int-subclasses from __index__() should still work for
all valid use cases.
Implementing __index__ just means "This type can be converted to a Python integer
without losing information". Aside
from that extra "without information loss" qualification, it's the same as
__int__.