syntax question: "<>" and "!=" operators

David Mertz, Ph.D. mertz at gnosis.cx
Sun Mar 17 15:08:08 EST 2002


| danb_83 at yahoo.com (Dan Bishop) wrote:
|> Even for complex numbers, for which "less than or greater than" is
|> meaningless?

Just van Rossum <just at xs4all.nl> wrote previously:
|It doesn't have that meaning for me anymore, it simple means "not equal"
|to me. It is an abstract symbol. I really don't believe we can discuss
|this on any other level than "I prefer x because I'm used to it"...

In the end, Just is right.  People get used to different things.

Nonetheless, I think of the natural language semantics of the
symbols--or maybe better "insinuations"--prefers '<>' to '!='.  The
(good) one suggests "is greater than or less than (but not equal to)".
I know that not everything is technically in an order relation, but it
still "makes sense" at a first approximation.  The (bad) one looks like
some odd sort of augmented assignment.  "Hmmm... assign, what?  The
negation of the right side to the left side?!  The LHS negated with the
RHS?!"

But then, I wrote virtually the same thing a few months ago, in almost
the same thread.  And I probably will again in six months.  And despite
my feeling on the "principle of least surprise", I don't have any real
trouble reading code that uses '!='.

--
    _/_/_/ THIS MESSAGE WAS BROUGHT TO YOU BY: Postmodern Enterprises _/_/_/
   _/_/    ~~~~~~~~~~~~~~~~~~~~[mertz at gnosis.cx]~~~~~~~~~~~~~~~~~~~~~  _/_/
  _/_/  The opinions expressed here must be those of my employer...   _/_/
 _/_/_/_/_/_/_/_/_/_/ Surely you don't think that *I* believe them!  _/_/





More information about the Python-list mailing list