Augmented Assignment (was: Re: PEP scepticism)

Guido van Rossum guido at python.org
Sat Jul 7 09:39:02 EDT 2001


Thomas Wouters <thomas at xs4all.net> writes:

> But
>     x = ()
>     x += y
> 
> is not, and that's exactly what I meant.

But x will never have a refcount of two in this case: there's one
reference from x, one from the argument list to +=, and one from the
global variable that holds on to the empty tuple so it can be shared
with others.

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



More information about the Python-list mailing list