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 sco1
Recipients sco1
Date 2021-04-13.18:27:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Came across this riddle today:

>>> [0x_for x in (1, 2, 3)]

Initially I thought this was related to PEP 515 but the unexpected behavior extends to simpler examples as well, such as:

>>> x = 5
>>> 123or x
>>> 123and x

I'm not familiar enough with C to understand why this is being parsed/tokenized this way, but this seems like it should instead be a SyntaxError. This appears to be fairly old behavior, as the non-underscored version works back to at least 2.7.

And a bonus:

>>> 0x1decade or more
Date User Action Args
2021-04-13 18:27:19sco1setrecipients: + sco1
2021-04-13 18:27:19sco1setmessageid: <>
2021-04-13 18:27:19sco1linkissue43833 messages
2021-04-13 18:27:19sco1create