Underscores in Python numbers

Raymond Hettinger python at rcn.com
Sat Nov 19 23:28:40 EST 2005


Gustav Hållberg wrote:
> I tried finding a discussion around adding the possibility to have
> optional underscores inside numbers in Python. This is a popular option
> available in several "competing" scripting langauges, that I would love
> to see in Python.
>
> Examples:
>   1_234_567
>   0xdead_beef
>   3.141_592

I suppose it could be done.  OTOH, one could argue that most production
code has no business hardwiring-in numerical constants greater than 999
;-)




More information about the Python-list mailing list