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 Orion Fisher
Recipients Orion Fisher
Date 2020-02-25.03:08:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1582600123.76.0.783865258946.issue39746@roundup.psfhosted.org>
In-reply-to
Content
I found a strange issue with how the interpreter produces bytecode for an expression like True != True in [False, False].

Reading it, one would expect the value of the expression to be True, whether the inequality comparison is evaluated first, or the membership test is evaluated first. Indeed, when parentheses are used to control the order of execution these results do occur.

However, without any parentheses, the result is False. The underlying cause seems to be in a short circuit which is dependent on the inequality comparison, seen in the JUMP_IF_FALSE_OR_POP instruction.

This expression is very synthetic, but I am submitting this bug under the worry that it speaks to a more significant error in the bytecode produced for inequality tests (or membership tests).
History
Date User Action Args
2020-02-25 03:08:43Orion Fishersetrecipients: + Orion Fisher
2020-02-25 03:08:43Orion Fishersetmessageid: <1582600123.76.0.783865258946.issue39746@roundup.psfhosted.org>
2020-02-25 03:08:43Orion Fisherlinkissue39746 messages
2020-02-25 03:08:43Orion Fishercreate