Obsolesence of <> (fwd)

James Logajan JamesL at Lugoj.Com
Thu May 31 19:40:49 EDT 2001


Alex Martelli wrote:
[ Shows that Python complex numbers do not support ">" or "<" but
  do support "<>" and states: ]
> 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?-)

Well, that could also be taken as evidence that someone forgot to implement
default ">" and "<" operations for complex numbers, not that they can't be
ordered. People have been creating default ordering operations, and even
equalities, for sets that aren't universally useful in all applications. For
example, does "A" == "a"? Sometimes it should. Why is "e" < "o"? When I
speak "e" it has a higher frequency than "o", so maybe I want comparisons
based on the lowest spoken harmonic. But instead, the orderings have been
done all wrong for my intended application! So maybe Python should remove
">" and "<" for character strings. Or maybe not.

Anyway, one can make some "interesting" justifications for just about any
position. Unfortunately as I've said long ago, bringing out hoary arguments
against "<>" doesn't exactly endorse the horrible usage if "!=". At least
proponents of "<>" can point to some pseudo mathematical justification for
"<>". All the proponents of "!=" can point to for justification is the usage
by syntactically unrelated languages, like "C". May as well start using
pointers, malloc, free, etc. So there! ;-)

Or better yet: just accept that neither "<>" and "!=" should be obsoleted
and let this issue die a deserved death. Somebody should inform Guido.



More information about the Python-list mailing list