[issue29869] Underscores in numeric literals not supported in lib2to3.

Serhiy Storchaka report at bugs.python.org
Wed Mar 22 07:56:56 EDT 2017


Serhiy Storchaka added the comment:

Python uses more strong rules for underscores in numerical literals. Underscores are acceptable between digits and between the base prefix and digit. For example the regular expression for hexadecimals is r'0[xX]_?[\da-fA-F]+(?:_[\da-fA-F]+)*[lL]?'.

Underscores also are acceptable in the exponent of float literals:

Exponent = r'[eE][-+]?\d+(?:_\d+)*'

----------
nosy: +georg.brandl, serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29869>
_______________________________________


More information about the Python-bugs-list mailing list