On 2009-06-18 14:15, Roland Schulz wrote: > > > On Thu, Jun 18, 2009 at 3:11 PM, Dag Sverre Seljebotn > <[email protected] > <mailto:[email protected]>> wrote: > > Dag Sverre Seljebotn wrote: > > Stefan Behnel wrote: > >> Dag Sverre Seljebotn wrote: > > > I stand corrected: > > In [13]: a = [1,2,3] > > In [14]: b = a > > In [15]: a += [1,2,3] > > In [16]: b > Out[16]: [1, 2, 3, 1, 2, 3] > > OK, so this seems like a non-issue. > > > interestingly : > > >>> a=(1,2,3) > >>> b=a > >>> b+=(4,) > >>> a > (1, 2, 3)
It's not that interesting. The augmented assignment operators "x ?= y" are defined to behave like "x = x ? y" except for *possible* in-place semantics. When the object is mutable, the operation is usually in-place. When the object is not mutable, then it is never in-place. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
