Integer literal with leading zero (MicroPython vs CPython) #10967
aivarannamaa
started this conversation in
General
Replies: 1 comment 1 reply
-
Yes, it is true:
Look carefully at the documentation: https://docs.python.org/3/library/functions.html#int
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Python 3 parser does not allow integer literals with leading zero, eg
012
. MicroPython does, but unlike Python 2 it does not treat it as an octal but simply ignores the leading zero.Is this documented somewhere? Wouldn't it be clearer if MicroPython disallowed leading zero like Python 3?
Beta Was this translation helpful? Give feedback.
All reactions