why no ++?

Mark Robinson m.1.robinson at herts.ac.uk
Fri Aug 3 09:35:29 EDT 2001


Charlie Clark wrote:

> Mark Robinson wrote:
> 
>> Just wondering. Can anyone tell me the rationale for leaving the ++/--
>> operator out of python. It is perhaps my only irritation with python,
>> it is just that I hate to have to write:
>> 
>> x = x + 1
> 
> no you don't.

I did, ya know

> 
>> when my whole being just yearns to type
>> 
>> x++
> 
> control yourself. Why should you want to type that? It's not necessary
> in Python's loops which automatically increment for you.
> 
Fair point, I guess that was the favorite hang out of the ++ operator, 
but not the only one. I guess it is getting lazy with not having to do
so much work in my for loops that makes me complain about it when I need
it in a while loop, thats when ++ would have been nice, but as has been
pointed out, I was simply ignorant of += having been implemented now.

> I like Python because when I read
> the discussions I understand why things are or are not there. 

I especially agree, makes me think a bit about how I use things too. Who 
knows before you know it I might actually write something I wasn't 
ashamed to show ;). Thats why I intend to carry on picking everyones 
brain on here.

Blobby





More information about the Python-list mailing list