autoincrementing

Dale Strickland-Clark dale at riverhall.NOTHANKS.co.uk
Tue Feb 25 07:35:29 EST 2003


Alex Martelli <aleax at aleax.it> wrote:

>
>For the same reason i?!@ doesn't work -- there is
>no ++ operator in Python, just as there is no ?!@
>operator (and MOST other sequences of special symbols
>and punctuation are also not operators, thanks be).
>
>Writing one more character to code +=1 instead of ++
>is no great hardship, and it would be absurd for
>Python to introduce a special operator just for the
>purpose of saving that one character.
>
>
>Alex

That is not the point of auto-increment (and I'm sure you must know
this)

   intPrev = intNew++

is equivalent to:

   intPrev = intNew
   intNew += 1

Rather more than one character saved. And there are times when it can
save you a lot more than that, too.
--
Dale Strickland-Clark
Riverhall Systems Ltd




More information about the Python-list mailing list