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

Gaute B Strokkenes gs234 at cam.ac.uk
Thu Mar 8 06:43:43 EST 2001


On Wed, 07 Mar 2001, JamesL at Lugoj.Com wrote:

> Greg Ewing wrote:
>> 
>> Victor Louie wrote:
>> >
>> > <> is obsolescent.
>> 
>> Really? I hope it's not taken away, because that will
>> break ALL of my code! I hate != (looks too much like
>> C), so I always use <>. Nobody ever told me I was doing
>> anything wrong!
> 
> Actually, for Python, "!=" IS totally bogus and should be considered
> the unusual variant. Unless the logical negation operation has been
> changed from "not" to "!" (shucks, version 1.5.2 still does all I
> need) then "!=" is not suggestive of anything. In "C" the "!=" was
> suggestive of:
> 
> !(expression1 == expression2)

I prefer != since it is one hell of a lot more reminiscent of the way
inequality is written in mathematics: as a equality sign with a
slightly slanted vertical line through it.  On the other hand, <>
doesn't look like anything even vaguely mathematical. 

PS |= wouldn't do, since it means something different entirely.

-- 
Gatue Strokkenes                        http://www.srcf.ucam.org/~gs234/
You mean now I can SHOOT YOU in the back and further BLUR
 th' distinction between FANTASY and REALITY?



More information about the Python-list mailing list