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

Peter Schneider-Kamp peter at schneider-kamp.de
Fri Mar 9 14:02:20 EST 2001


Dave Brueck wrote:
> 
> 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

Well, Python *does* define an ordering of a and b, no matter what
a and b may be. E.g.:

>>> 1 > (1,2)
0
>>> 1 < (1,2)
1
>>> {"a":1} < u"hello world"
1
>>> {"a":1} > u"hello world"
0

So, yes, interpreting "a <> b" as "(a < b) or (a > b)" makes
perfect sense in Python.

not-sure-comparing-strings-and-dictionaries-is-a-sane-thing-to-do-ly
y'rs
Peter




More information about the Python-list mailing list