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 mark.dickinson
Recipients belopolsky, benjamin.peterson, hpesoj, lehmannro, mark.dickinson, pitrou, rhettinger, stargaming
Date 2009-09-24.20:05:44
SpamBayes Score 1.96605e-09
Marked as misclassified No
Message-id <1253822745.84.0.43198987628.issue1766304@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2009-09-24 20:05:45mark.dickinsonsetrecipients: + mark.dickinson, rhettinger, belopolsky, pitrou, stargaming, benjamin.peterson, lehmannro, hpesoj
2009-09-24 20:05:45mark.dickinsonsetmessageid: <1253822745.84.0.43198987628.issue1766304@psf.upfronthosting.co.za>
2009-09-24 20:05:44mark.dickinsonlinkissue1766304 messages
2009-09-24 20:05:44mark.dickinsoncreate