Starting in Python 3.2, range() supports fast containment checking for
integers (i.e. based on an O(1) arithmetic calculation rather than an
O(N) iteration through the entire sequence).
Currently, this fast path ignores objects that implement __index__ -
they are relegated to the slow iterative
On 12/26/2010 7:15 PM, Nick Coghlan wrote:
Starting in Python 3.2, range() supports fast containment checking for
integers (i.e. based on an O(1) arithmetic calculation rather than an
O(N) iteration through the entire sequence).
Currently, this fast path ignores objects that implement __index__
What are the actual used of .__index__?
Can you please rephrase this question?
Regards,
Martin
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
On Mon, Dec 27, 2010 at 11:52 AM, Terry Reedy tjre...@udel.edu wrote:
Return a converted to an integer. Equivalent to a.__index__().
comes close to implying equality (if possible).
What are the actual used of .__index__?
PEP 357 gives the original rationale - it was to allow integer-like