"!=" is bad form. Re: sorry....never mind

Dave Brueck dbrueck at edgix.com
Fri Mar 9 15:14:09 CET 2001


> [mailto:python-list-admin at python.org]On Behalf Of James Logajan
> Sent: Thursday, March 08, 2001 10:42 PM
> To: python-list at python.org
> Subject: Re: "!=" is bad form. Re: sorry....never mind
> Ironically, I like C and have been coding in C on and off for it
> seems just
> about forever (well, 18 some years I think). And I find programming in C a
> mostly pleasurable experience. Yet as I stated earlier, for Python "<>"
> feels "righter" to me than "!=". I suspect it is a triviality for both
> programmers to understand, and the language to support, both forms. While
> deprecating "<>" in Python would not mean the end of civilization
> as we know
> it, it would be a damn shame anyway.
>
>
> (a > b) or (a == b)  --->  (a >= b)
> (a < b) or (a == b)  --->  (a <= b)
> (a < b) or (a >  b)  --->  (a <> b)

I don't really care if Python keeps <>, but the reason I don't like it is
because of the example listed above: to me seeing "<>" implies something
about the ordering of a and b, namely (a < b) or (a > b), even when such an
ordering does not exist (e.g. - it doesn't make sense to say one instance of
a cooking recipe object is "greater than" or "less than" another one (unless
maybe you order them by yumminess), but it does make sense to say they
"aren't equal"). I know <> doesn't _really_ imply any such thing in Python,
but still..

-Dave





More information about the Python-list mailing list