Author serhiy.storchaka
Recipients mark.dickinson, serhiy.storchaka, steven.daprano
Date 2018-04-18.11:27:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1524050863.06.0.682650639539.issue33305@psf.upfronthosting.co.za>
In-reply-to
Content
PR 6517 improves syntax error messages for invalid numerical literals.

>>> 012
  File "<stdin>", line 1
SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers
>>> 0o129
  File "<stdin>", line 1
SyntaxError: invalid digit '9' in octal literal
>>> 0o
  File "<stdin>", line 1
SyntaxError: invalid octal literal
>>> 1_2_
  File "<stdin>", line 1
SyntaxError: invalid decimal literal
>>> 0.1_2_
  File "<stdin>", line 1
SyntaxError: invalid decimal literal
>>> 12e+
  File "<stdin>", line 1
SyntaxError: invalid decimal literal
>>> 12e+1_
  File "<stdin>", line 1
SyntaxError: invalid decimal literal

"SyntaxError: invalid token" was emitted before.

No tests yet. Suggestions about error messages are welcome.
History
Date User Action Args
2018-04-18 11:27:43serhiy.storchakasetrecipients: + serhiy.storchaka, mark.dickinson, steven.daprano
2018-04-18 11:27:43serhiy.storchakasetmessageid: <1524050863.06.0.682650639539.issue33305@psf.upfronthosting.co.za>
2018-04-18 11:27:43serhiy.storchakalinkissue33305 messages
2018-04-18 11:27:42serhiy.storchakacreate