Obsolesence of <> (fwd)

Alex Martelli aleaxit at yahoo.com
Thu May 31 17:57:43 EDT 2001


"Lulu of the Lotus-Eaters" <mertz at gnosis.cx> wrote in message
news:mailman.991326649.30280.python-list at python.org...
    ...
> It is very easy to read it as "is less than or greater than" on the
> analogy of ">=" reading "is greater than or equal to."  Since all Python
> values can be compared, every two unequal things are indeed less than or

Sorry, you're behind the times:

Python 2.1 (#15, Apr 16 2001, 18:25:49) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
Alternative ReadLine 1.1 -- Copyright 2001, Chris Gonnerman
>>> x=2+3j
>>> y=5+8j
>>> x<y
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: cannot compare complex numbers using <, <=, >, >=
>>> x>y
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: cannot compare complex numbers using <, <=, >, >=
>>> x<>y
1


Here, I cannot write x>y, nor x<y, in 2.1 and later.  So, by your
reasoning, I shouldn't be able to write x<>y either, right?-)


Alex






More information about the Python-list mailing list