"Cameron Laird" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > In article <[EMAIL PROTECTED]>, > Dan Perl <[EMAIL PROTECTED]> wrote: > . > . > . >>has the conciseness of the C statement. The pre- and post-increment >>and -decrement in C/C++/Java are very powerful and I miss them in python. > > Me, too. > > Which is, I suspect, evidence for the incompleteness of our Pythonhood. > As Peter Hansen already hinted in this thread, an appetite for the > increment and related operators probably is a symptom that there's an > opportunity nearby to use an iterator or string method or such. C++ > and Java wish they had it so good.
I can't say that is not part of the reason, but the example in the OP is a clear illustration of cases where something like an increment/decrement operator would be very useful. OTOH, I was thinking of saying in my previous posting that I prefer for n in range(start, 0, -1): to n = start while (n--) I think that the first form is more readable, although that may be just me. I would actually even prefer the 'for' statement in C to the 'while' statement: for (n=start; n<=0; n--) -- http://mail.python.org/mailman/listinfo/python-list