[Python-ideas] Mixed script numbers. Was: Unicode minus sign in numeric conversions

Alexander Belopolsky alexander.belopolsky at gmail.com
Tue Jun 11 04:28:24 CEST 2013


I am changing the subject because the issue of mixing digits from different
scripts is quite different from the issue of accepting MINUS SIGN.  I left
a comment on the original subject at the issue tracker: <
http://bugs.python.org/issue6632#msg190881>.


On Mon, Jun 10, 2013 at 8:53 PM, Steven D'Aprano <steve at pearwood.info>
wrote:
>
> On 10/06/13 05:35, Alexander Belopolsky wrote:
>>
>> ...  Consider this case:
>>
>>>>> float('123٠95')
>> 123095.0
>>
>> Depending on your font, '123٠95' may be indistinguishable from '123.95'.
>
>
> Indistinguishable *by eye* maybe, but the same applies to ASCII,
> 365lO98, and there are plenty of ways to distinguish them other
> than by a careless glance at the screen.
>
> [Aside: I have seen users type I or O for digits, based on the fact
> that it works fine when using a typewriter, and I've read books from
> the 1970s that recommended that number parsers accept I, L and O
> for just that reason.]

I am not sure why your example is relevant.  There is little harm from
accepting O for zero, but accepting it for say 8 would be a different story.

>
> It would be a pretty awful font that made ٠ look like . But even if it
did, what is the concern here?
> If somebody enters a mixed script number, presumably they have some
reason for it.

Sure, say someone who wants to sell you a $23.95 gadget for $23,095. :-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130610/e286f1da/attachment.html>


More information about the Python-ideas mailing list