One last shot at the Augmented Assignment PEP

Darren New dnew at
Thu Sep 14 19:46:49 CEST 2000

Alex Martelli wrote:
> If you care about other references being unaffected, you must
> always explicitly copy.copy() [sometimes copy.deepcopy()] the
> object before calling on it methods that may mutate it. 

You could work it the way Tcl does, and look at the reference count. Treat
it semantically as L = L + [a] but optimize the case where L has a refcount
of 1 to change it to and L.append() type of call.  I don't know how feasible
this is in reality, with multiple implementations of the interpreter in
different languages and such...

Darren New / Senior MTS & Free Radical / Invisible Worlds Inc.
San Diego, CA, USA (PST).  Cryptokeys on demand.
"No wonder it tastes funny. 
            I forgot to put the mint sauce on the tentacles."

More information about the Python-list mailing list