Serhiy Storchaka <storch...@gmail.com> added the comment:

> On a side note, glancing at Python-3.3.0a4/Objects/rangeobject.c:
> range_contains seems to iterate through the entire range whereas __contains__ 
> from the attached Range.py is O(1)

See issue1766304. For int range.__contains__ is O(1), for custom types this 
optimization is impossible without losing backward compatibility.

----------
nosy: +storchaka

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15224>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to