pzelnip
(Adam Parkin)
October 24, 2018, 5:48pm
1
Steps to Reproduce:
Put a numeric constant with separators (new in Python 3.6):
MAX_AMOUNT = 9_999_999_999.99
With v1.10 of the SonarPython plugin, this produces a parse error:
85:
86:
--> MAX_AMOUNT = 9_999_999_999.99
87:
It’s perhaps worth noting that the popular Python code formatter Black will automatically insert these on large numeric literals.
pzelnip
(Adam Parkin)
October 24, 2018, 5:48pm
2
The PEP which outlines the support of underscores in numeric literals: https://www.python.org/dev/peps/pep-0515/
Hi Adam,
Yes, I can reproduce. Of course we should improve this, ticket created SONARPY-293 .
Thanks for your feedback and your help with the PEP reference
Alban
1 Like