Why prefer != over <> for Python 3.0?

Dan Bishop danb_83 at yahoo.com
Sun Mar 30 19:38:01 CEST 2008


On Mar 30, 5:40 am, Torsten Bronger <bron... at physik.rwth-aachen.de>
wrote:
> Hallöchen!
>
> Bjoern Schliessmann writes:
> > Lie wrote:
>
> >> Ah yes, that is also used (I completely forgot about that one, my
> >> math's aren't that sharp anymore) and I think it's used more
> >> frequently than ><.
>
> > Where did you read that (I mean, which country)? I've never seen
> > this sign in any german or english book on
> > mathematics/physics/engineering I saw.
>
> Maybe he means "≷".
>
> >> but my argument was that no math book use != or <> (except in
> >> math for programmers).
>
> > That's true. Personally, I don't ever use "a!=b" in favor of "not
> > a==b".
>
> As a side note, I've always found == rather ugly.  I'd prefer to
> have = for both purposes.

The earliest versions of Python *did* use = for both purposes.

> The constructs that wouldn't work anymore
> are rare as far as I can see (and possibly there are even
> workarounds).

The construct a = b == c could be rewritten as a = (b = c).



More information about the Python-list mailing list