incrementation operators?

Alex Martelli alex at magenta.com
Sun Aug 13 15:33:15 EDT 2000


"Tim Peters" <tim_one at email.msn.com> wrote in message
news:LNBBLJKPBEHFEDALKOLCGEIKGPAA.tim_one at email.msn.com...
    [snip]
> too.  While everyone thinks "add 1 to i" from time to time, *nobody*
thinks
> "plus plus i" <wink>.
>
> "incr-i"-is-a-nice-thing-to-think-but-remains-unspeakable-ly y'rs

"Increment i" is a *very* common thought, and translating it into
"add one to i" _is_ one level of indirection.  "Increment" is a more
fundamental notion: counting (a succession of increments) is
psychologically before "addition" (e.g. in children's mental
development), and "successor" is one of the fundamental pillars
on which Peano's axioms build the naturals ("zero" being the
other one; "addition" and "1" are less-fundamental concepts,
which get _defined_ in terms of the others).

But getting inc(x) and dec(x) as built-in synonyms of x+=1
and x-=1 can always be lobbied for later, I guess:-).


Alex






More information about the Python-list mailing list