[Python-ideas] [Python-Dev] Unicode minus sign in numeric conversions

Alexander Belopolsky alexander.belopolsky at gmail.com
Sun Jun 9 21:35:23 CEST 2013


On Sun, Jun 9, 2013 at 12:47 PM, Łukasz Langa <lukasz at langa.pl> wrote:

> Wikipedia started serving numerical data with \N{MINUS SIGN} instead of
> 0x2D, for instance on climate tables. I think we'll see increased usage of
> such characters in the wild.


While I don't think MINUS SIGN can be abused this way, you should be very
careful when you copy numerical data from the web.   Consider this case:

>>> float('123٠95')
123095.0

Depending on your font, '123٠95' may be indistinguishable from '123.95'.

If you do research using numerical data published on the web, you will be
well advised not to assume that anything that looks like a number to your
eye can be fed to python's float().
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130609/c82abc00/attachment-0001.html>


More information about the Python-ideas mailing list