Why prefer != over <> for Python 3.0?
Gabriel Genellina
gagsl-py2 at yahoo.com.ar
Sat Mar 29 20:00:43 EDT 2008
En Sat, 29 Mar 2008 16:24:01 -0300, Michael Wieher
<michael.wieher at gmail.com> escribió:
> to me it seems simple.
>
> C uses !=
>
> why does C use != .... because its kind of hard to type the "equal with a
> slash"
In C, ! by itself is the logical "not", so !(a==b) is the same as (a!=b)
and that's rather consistent.
Python doesn't use ! for anything else; != is rather arbitrary but
certainly much better than <> (for many objects < and > are meaningless;
being equal or not equal has nothing to do with being less or greater)
--
Gabriel Genellina
More information about the Python-list
mailing list