This is not implemented in python at the present time. You can look at the lexical analysis for strict definitions python2.7, python3.5 ...
Supposedly it will be implemented for python3.6, but it doesn't look like the documentation has been updated for that yet, nor is it available in python3.6.0a2:
Python 3.6.0a2 (v3.6.0a2:378893423552, Jun 13 2016, 14:44:21)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 1_000
File "<stdin>", line 1
1_000
^
SyntaxError: invalid syntax
>>> amount = 10_000_000.0
File "<stdin>", line 1
amount = 10_000_000.0
^
SyntaxError: invalid syntax
When it is implemented, you'll be able to use _
in your integer and float literals...
int('100,000'.replace(',', ''))
is ok? – Nizam Mohamed 3 hours ago