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 pconnell
Recipients benjamin.peterson, brett.cannon, georg.brandl, isoschiz, ncoghlan, pconnell
Date 2013-06-14.08:42:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1371199354.64.0.33010347301.issue18208@psf.upfronthosting.co.za>
In-reply-to
Content
The following two expressions should have the same value:

Python 3.4.0a0 (default:fae92309c3be, Jun 14 2013, 09:29:54) 
[GCC 4.8.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 1 in [2] == False
False
>>> (1 in [2]) == False
True


It looks like this is a compiler issue - there shouldn't be a jump if the 'in' expression is false:

>>> dis.dis("1 in [2] == False")
  1           0 LOAD_CONST               0 (1)
              3 LOAD_CONST               1 (2)
              6 BUILD_LIST               1
              9 DUP_TOP             
             10 ROT_THREE           
             11 COMPARE_OP               6 (in)
             14 JUMP_IF_FALSE_OR_POP    24
             17 LOAD_CONST               2 (False)
             20 COMPARE_OP               2 (==)
             23 RETURN_VALUE        
        >>   24 ROT_TWO             
             25 POP_TOP             
             26 RETURN_VALUE        
>>>
History
Date User Action Args
2013-06-14 08:42:34pconnellsetrecipients: + pconnell, brett.cannon, georg.brandl, ncoghlan, benjamin.peterson, isoschiz
2013-06-14 08:42:34pconnellsetmessageid: <1371199354.64.0.33010347301.issue18208@psf.upfronthosting.co.za>
2013-06-14 08:42:34pconnelllinkissue18208 messages
2013-06-14 08:42:33pconnellcreate