Favorite non-python language trick?

Terry Hancock hancock at anansispaceworks.com
Sun Jun 26 06:29:49 EDT 2005


On Saturday 25 June 2005 01:08 pm, Steven D'Aprano wrote:
> Using := and = for assignment and equality is precisely as stupid as using
> = and == for assignment and equality. Perhaps less stupid: why do we use
> == for equals, but not ++ for plus and -- for minus?

Probably the most pointless Python wart, I would think. The =/==
distinction makes sense in C, but since Python doesn't allow assignments
in expressions, I don't think there is any situation in which the distinction
is needed.  Python could easily figure out whether you meant assignment
or equality from the context, just like the programmer does.

BASIC did it that way, IIRC.  It always seemed like C was seriously twisted
for letting you get away with assignment in expressions in the first place.

I don't think Python's use of "==" has *ever* helped me find a bug, it
just creates them.  I really think "=" ought to be accepted as well, and
"==" deprecated.

But, hey, nobody asked me, I guess. And it doesn't kill me to type the
extra "=".  ;-)

Cheers,
Terry

--
Terry Hancock ( hancock at anansispaceworks.com )
Anansi Spaceworks  http://www.anansispaceworks.com




More information about the Python-list mailing list