Message191108
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
>>> |
|
Date |
User |
Action |
Args |
2013-06-14 08:42:34 | pconnell | set | recipients:
+ pconnell, brett.cannon, georg.brandl, ncoghlan, benjamin.peterson, isoschiz |
2013-06-14 08:42:34 | pconnell | set | messageid: <1371199354.64.0.33010347301.issue18208@psf.upfronthosting.co.za> |
2013-06-14 08:42:34 | pconnell | link | issue18208 messages |
2013-06-14 08:42:33 | pconnell | create | |
|