__iadd__ and fellows missing (Python 2.2)

Terry Reedy tejarex at yahoo.com
Sat Apr 13 10:39:49 EDT 2002


"Ralf Juengling" <juenglin at informatik.uni-freiburg.de> wrote in
message news:xdulmbr51x3.fsf at leto.informatik.uni-freiburg.de...
> I understand now, that 'i+=1' is no real in-place operation

Nor is it a false in-place operation :<)

> but  just a shortcut for 'i=i+1' since int is immutable.

Correct.  This is true for all immutable types.

> For the sake of clarity, an 'in-place' operation should really
> work in-place, don't you think?

Yes, but +=, etc, are not in-place operations, and are not advertised
as such.

Python is not C, or any other language except itself.

Terry J. Reedy






More information about the Python-list mailing list