A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2010-November/106092.html below:

[Python-Dev] Python and the Unicode Character Database

[Python-Dev] Python and the Unicode Character Database"Martin v. Löwis" martin at v.loewis.de
Mon Nov 29 00:33:23 CET 2010
>>>>>>> float('١٢٣٤.٥٦')
>>>> 1234.56
> 
> Even if this is somehow an accident or something that someone snuck in,
> I think it a good idea that *users* be able to input amounts with their
> native digits. That is different from requiring *programmers* to write
> literals with euro-ascii-digits

So one question is what kind of data float() is aimed at. I claim that
it is about "programmer" data, not "user" data. If it supported "user"
data, it probably would have to support "1,000" to denote 1e3 in the
U.S., and denote 1e0 in Germany. Our users are generally confused
on whether they should use th full stop or the comma as the decimal
separator.

As not even the locale-dependent issues are considered in float(),
it is clear to me that entering local numbers cannot possibly be
the objective of the function.

Instead, following a wide-spread Python convention, it is meant to be
the reverse of repr().

Can you name a single person who actually wants to write '١٢٣٤.٥٦'
as a number? I'm fairly skeptical that users of arabic-indic digits.
Instead,

http://en.wikipedia.org/wiki/Decimal_separator

suggests that they would rather U+066B, i.e. '١٢٣٤٫٥٦', which isn't
supported by Python.

Regards,
Martin
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4