Compound Assignment Operators ( +=, *=, etc...)
esuzm at primrose.csv.warwick.ac.uk
Sun Aug 15 23:56:18 CEST 1999
Tom Christiansen (tchrist at mox.perl.com) wrote:
> Common rebuttals [to += and co.] include:
> 3) It's more efficient to keep a tmpobj anyway.
Bah. Temporary variables are evil!
> 4) Redundancy can clarify through redundancy.
Wossat? Sounds like rot to me. :-)
> As to why there's no x++ there, consider how often people from a
> Pascal(ish) background are confused between x+1 and x++ and ++x, and
> you'll begin to see what kind of problems caused it to be vetoed.
This is a good point, but stems from C's tendency to return values all
the time from things I think it shouldn't. :-)
I'd like a syntax like:
With the idea that x is an object (of type int) with a '+' method that
adds stuff to it. It'd be nicer without the brackets though.
:opens the language can of worms again
This posting was brought to you by And Clover.
More information about the Python-list