[issue18208] Wrong bytecode generated for 'in' operation

2013-06-14 Thread Phil Connell
Phil Connell added the comment: Thanks Amaury. That's quite surprising, but I wouldn't advocate changing such long standing behaviour. I'm closing the issue. -- status: pending -> closed ___ Python tracker __

[issue18208] Wrong bytecode generated for 'in' operation

2013-06-14 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: This is one case of chained comparisons: http://docs.python.org/3/reference/expressions.html#not-in "x <= y <= z" is equivalent to "(x <= y) and (y <= z)" "x in y == z" is equivalent to "(x in y) and (y == z)" There is a jump if the 'in' expression is fal

[issue18208] Wrong bytecode generated for 'in' operation

2013-06-14 Thread Phil Connell
New submission from Phil Connell: 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]) == Fals