A little disappointed so far

Joshua Marshall joshway_without_spam at mathworks.com
Mon May 19 11:38:29 EDT 2003


Terry Reedy <tjreedy at udel.edu> wrote:

> "Graham Nicholls" <graham at rockcons.co.uk> wrote in message
...

>> BTW, why no ++ operator?

> a) ints are not mutable.  This gets to the difference between 'name
> denotes block of memory' (as in C, etc) and 'name denotes object' (as
> in Python, etc).

This doesn't matter - "++" dosen't need to affect the integer object.
It could be defined so that:
 
  >>> x = 1
  >>> y = x++
  >>> x
  2
  >>> y
  1

But I don't think it's a good idea.  I personally dislike this feature
of C.




More information about the Python-list mailing list