Augmented Assignment (was: Re: PEP scepticism)

Guido van Rossum guido at python.org
Sat Jun 30 08:59:04 EDT 2001


Paul Prescod <paulp at ActiveState.com> writes:

> My point is that it is hard for a new user to "believe me" (or at least
> understand me) when I say that tuples are not mutable but they see them
> changing right in front of their eyes:
> 
> >>> a=(1,2,3)
> >>> a+=(8,3)
>
> The old behaviors strongly emphasized the non-mutability of things. The
> new operators undermine that understanding. Maybe the benefits outweigh
> this cost but I've seen this misunderstanding myself so I know it is a
> real cost.

I have a few slides with some very effective pictures showing what's
going on here, after which it is a non-issue.

--Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-list mailing list