Using non-ascii symbols

Christoph Zwerschke cito at online.de
Tue Jan 24 11:31:34 EST 2006


Juho Schultz wrote:
> Fortran 90 allowed >, >= instead of .GT., .GE. of Fortran 77. But F90 
> uses ! as comment symbol and therefore need /= instead of != for 
> inequality. I guess just because they wanted. However, it is one more 
> needless detail to remember. Same with the suggested operators.

The point is that it is just *not* the same. The suggested operators are 
universal symbols (unicode). Nobody would use ≠ as a comment sign. No 
need to remember was it .NE. or -ne or <> or != or /= ...

There is also this old dispute of using "=" for both the assignment 
operator and equality and how it can confuse newcomers and cause errors. 
  A consequent use of unicode could solve this problem:

a ← b # Assignment (now "a = b" in Python, a := b in Pascal)
a = b # Eqality (now "a == b" in Python, a = b in Pascal)
a ≡ b # Identity (now "a is b" in Python, @a = @b in Pascal)
a ≈ b # Approximately equal (may be interesting for floats)

(I know this goes one step further as it is incompatible to the existing 
use of the = sign in Python).

Another aspect: Supporting such symbols would also be in accord with 
Python's trait of being "executable pseudo code."

-- Christoph



More information about the Python-list mailing list