This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author barry
Recipients barry, docs@python
Date 2013-03-29.22:29:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1364596178.4.0.170619927624.issue17576@psf.upfronthosting.co.za>
In-reply-to
Content
You also end up with this nice bit of inconsistency:

>>> x = myint(7)
>>> from operator import index
>>> range(10)[6:x]
range(6, 7)
>>> range(10)[6:x.__index__()]
range(6, 8)
>>> range(10)[6:index(x)]
range(6, 7)
>>> 

Granted, it's insane to have __index__() return a different value like this, but in my specific use case, it's the type of object returned from operator.index() that's the problem.  operator.index() returns the subclass instance while obj.__index__() returns the int.

(The use case is the IntEnum of PEP 435.)
History
Date User Action Args
2013-03-29 22:29:38barrysetrecipients: + barry, docs@python
2013-03-29 22:29:38barrysetmessageid: <1364596178.4.0.170619927624.issue17576@psf.upfronthosting.co.za>
2013-03-29 22:29:38barrylinkissue17576 messages
2013-03-29 22:29:38barrycreate