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/106075.html below:

[Python-Dev] Python and the Unicode Character Database

[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
Sun Nov 28 23:17:13 CET 2010
>>>>> float('١٢٣٤.٥٦')
>> 1234.56

I think it's a bug that this works. The definition of the float builtin says

Convert a string or a number to floating point. If the argument is a
string, it must contain a possibly signed decimal or floating point
number, possibly embedded in whitespace. The argument may also be
'[+|-]nan' or '[+|-]inf'.

Now, one may wonder what precisely a "possibly signed floating point
number" is, but most likely, this refers to

floatnumber   ::=  pointfloat | exponentfloat
pointfloat    ::=  [intpart] fraction | intpart "."
exponentfloat ::=  (intpart | pointfloat) exponent
intpart       ::=  digit+
fraction      ::=  "." digit+
exponent      ::=  ("e" | "E") ["+" | "-"] digit+
digit          ::=  "0"..."9"

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