[Python-ideas] float('∞')=float('inf')

Alexander Belopolsky alexander.belopolsky at gmail.com
Fri Jul 12 19:21:49 CEST 2013


On Fri, Jul 12, 2013 at 12:15 PM, Joshua Landau <joshua at landau.ws> wrote:

> > I would actually support the idea for float() to accept whatever
> > unicodedata.numeric() accepts.
>
> It doesn't free us from tons of special cases. We already have people
> arguing over whether 3½ is the traditional 3.5 or whether it's 1.5.
> We'll need tons of new parsing rules. I'm not convinced, in other
> words.


I should have explained my idea in more detail.  I am not suggesting that
float('3½') should work.  I wrote: "float() to accept whatever
unicodedata.numeric()
accepts" and

>>> unicodedata.numeric('3½')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: need a single Unicode character as parameter

Since python does not have a character type, I think it is acceptable for
single-character strings to be special.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130712/64ba5dd0/attachment.html>


More information about the Python-ideas mailing list