Underscores in Python numbers

bonono at gmail.com bonono at gmail.com
Sat Nov 19 20:40:42 EST 2005


Steve Holden wrote:
> Being European myself I am well aware of the notational differences of
> the different locales, and I am perfectly happy that users can enter
> numbers in their preferred format when they execute a program.
>
> However, I am not happy about the idea that a program source would need
> to be edited before it would work after being moved to another locale.
>
Huh ?

Up to now, all I am talking about is making the three init
function(int/float/decimal) to be smarter on coverting string to their
type. It doesn't affect the code in anyway if you don't need it or want
to use it. It is more like a helper function for the issue of people
are so concern about the seperators in big numbers. It introduce no new
syntax to the language at all. And should you say use the imaginary
format "E500.000,23", it still works no matter where your program is
running or what the hosting locale is. Don't understand what changes
you are referring to.

We are facing similar issue today. A typical case is MM/DD/YYYY date
format. Or may be I need to import text file(csv for example) which may
already contain numbers in this format.




More information about the Python-list mailing list