[issue33304] Syntax Error on leading 0 in integer tokens

2018-04-17 Thread Steven D'Aprano
Steven D'Aprano added the comment: I've opened an issue to improve the error message: #33305 -- ___ Python tracker ___

[issue33304] Syntax Error on leading 0 in integer tokens

2018-04-17 Thread Steven D'Aprano
Steven D'Aprano added the comment: This is not a bug, it is intentional. In Python 2, numbers with a leading zero are interpreted as octal, leading to surprising results: py> 015 13 In Python 3, we use 0o15 to get octal, and 015 becomes a syntax error.

[issue33304] Syntax Error on leading 0 in integer tokens

2018-04-17 Thread jackb
New submission from jackb : Entering 007 gives a syntax error. Should return 7. 00 correctly returns 0. 007. correctly returns 7.0. -- components: Interpreter Core messages: 315429 nosy: jackb priority: normal severity: normal status: open title: Syntax Error on