Underscores in Python numbers

bonono at gmail.com bonono at gmail.com
Sat Nov 19 00:59:29 EST 2005


Steven D'Aprano wrote:
> On Fri, 18 Nov 2005 16:26:08 -0800, bonono at gmail.com wrote:
>
> > Personally, I would rather see the int() and float() function be
> > smarter to take what is used for this, i.e. :
> >
> > a = int("1,234,567")
>
> But the problem isn't just with conversion of strings. It is also
> with literals.
>
> n = 99999999999
>
> Without counting, how many nines?
For readability, I don't see why it cannot be written as :

   n = int("99,999,999,999")

we already needs to do this for decimal("9.9")




More information about the Python-list mailing list