subtraction is giving me a syntax error

Benjamin Kaplan benjamin.kaplan at case.edu
Tue Mar 16 16:42:05 EDT 2010


On Tue, Mar 16, 2010 at 4:12 PM, Grant Edwards <invalid at invalid.invalid>wrote:

> On 2010-03-16, Vito 'ZeD' De Tullio <zak.mc.kraken at libero.it> wrote:
> > Grant Edwards wrote:
> >
> >>> As for not being able to see the difference between a hyphen and an
> >>> EN- dash, or minus sign, or whatever it is, yes but they are very
> >>> similar looking glyphs in virtually ever modern font. It would take a
> >>> good eye to see the difference between (say) ??? ??? and -.
> >>
> >> My point is that if it's an ASCII file,
> >
> > source files aren't (necessary) ASCII files
>
> OK, if it's a file with encoding <whatever>, then characters that
> aren't part of <whatever> shouldn't be rendered according so some
> other arbitrary character set.  Illegal characters should be flagged
> and displayed in a manner that makes it obvious you have illegal
> characters in in the file.
>
> If the OP was using a source file with an encoding that isn't accepted
> by Python, then he needs to pick a source file encoding that is
> recognized by Python.
>
> Using a source file encoding where there are semantically _different_
> characters that render identically is just asking for pain...
>
>
>>> print u'\N{HYPHEN-MINUS}'
-
>>> print u'\N{MINUS SIGN}'
−
>>> print u'\N{SMALL HYPHEN-MINUS}'
﹣
>>> print u'\N{FIGURE DASH}'
‒
>>> print u'\N{EN DASH}'
–
>>> print u'\N{SMALL EM DASH}'
﹘
>>> print u'\N{EM DASH}'
—
>>> print u'\N{HORIZONTAL BAR}'
―


Good luck finding a character encoding where you can see the difference
between each of those in context. Do you program in a hex editor?


> --
> Grant Edwards               grant.b.edwards        Yow! I guess you guys
> got
>                                  at               BIG MUSCLES from doing
> too
>                              gmail.com            much STUDYING!
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100316/ba7fd2ea/attachment.html>


More information about the Python-list mailing list