Underscores in Python numbers

bonono at gmail.com bonono at gmail.com
Sat Nov 19 04:55:12 EST 2005


Stefan Rank wrote:
> The other idea of teaching int() about separator characters has
> internationalis/zation issues:
> In many European countries, one would naturally try::
>
>    int('500.000,23')
>
> instead of::
>
>    int('500,000.23')

That is why I said

"Of course, also support the locale variant where the meaning of ","
and
"." is swapped in most European countries. "

We are seeing the same about base 2, 8, 10, 16.

May be :

int("E500.000,23")

as we are using :

0xffff 

already for hex number




More information about the Python-list mailing list