This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ezio.melotti
Recipients belopolsky, ezio.melotti, mark.dickinson, vstinner
Date 2010-11-28.04:29:32
SpamBayes Score 2.0044792e-05
Marked as misclassified No
Message-id <>
I think float() should support non-ascii digits but I agree that it would be better to avoid UnicodeErrors and convert them to ValueErrors so that

>>> float('١٢٣٤.٥٦')


>>> float('½')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: invalid literal for float(): ½

I.e. float should do the C equivalent of:
  s = arg.encode('decimal')
except UnicodeEncodeError:
  raise ValueError('Invalid liter for float(): {}'.format(arg))

Note that int() and Decimal() supports non-ascii chars too.
Date User Action Args
2010-11-28 04:29:34ezio.melottisetrecipients: + ezio.melotti, mark.dickinson, belopolsky, vstinner
2010-11-28 04:29:34ezio.melottisetmessageid: <>
2010-11-28 04:29:32ezio.melottilinkissue10557 messages
2010-11-28 04:29:32ezio.melotticreate