You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MicroPython v1.26.0-preview.24.gcd8fad919f.dirty on 2025-04-22; linux [GCC 12.2.0] version
Reproduction
micropython -c 'print(0x1or 2)
python3.9 -c 'print(0x1or 2)
Expected behaviour
Both implementations print the same value
Observed behaviour
micropython raises an exception, while python prints "1" (Python versions starting with 3.11 print a warning though)
Additional Information
The warning about this syntax appeared in Python 3.11 as a result of https://bugs.python.org/issue43833. There appears to be no intent to actually convert this to a SyntaxError, though only for the risk of breaking existing code, not because anyone likes the construct.
Sorry for not filing this bug on April 1. Some post on mastodon alerted me to the fact that 0x1for....real is valid Python and I just had to check it out on micropython.
Code of Conduct
Yes, I agree
The text was updated successfully, but these errors were encountered:
Port, board and/or hardware
unix
MicroPython version
MicroPython v1.26.0-preview.24.gcd8fad919f.dirty on 2025-04-22; linux [GCC 12.2.0] version
Reproduction
micropython -c 'print(0x1or 2)
python3.9 -c 'print(0x1or 2)
Expected behaviour
Both implementations print the same value
Observed behaviour
micropython raises an exception, while python prints "1" (Python versions starting with 3.11 print a warning though)
Additional Information
The warning about this syntax appeared in Python 3.11 as a result of https://bugs.python.org/issue43833. There appears to be no intent to actually convert this to a SyntaxError, though only for the risk of breaking existing code, not because anyone likes the construct.
Sorry for not filing this bug on April 1. Some post on mastodon alerted me to the fact that
0x1for....real
is valid Python and I just had to check it out on micropython.Code of Conduct
Yes, I agree
The text was updated successfully, but these errors were encountered: