Mark Dickinson <dicki...@gmail.com> added the comment:

Just to be on the safe side, I changed the PyLong_Check(ob) check to 
PyLong_CheckExact(ob) || PyBool_Check(ob), in r75051.  Without this, one 
can get different results for 'x in range(10)' and 'x in list(range(10))' 
if x is an instance of a subclass of int:

Python 3.2a0 (py3k:75050, Sep 24 2009, 20:56:13) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> class C(int):
...     def __eq__(self, other): return True
... 
>>> C(11) in range(10)
False
>>> C(11) in list(range(10))
True

----------

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

Reply via email to