unexpected behavior: did i create a pointer?

Bruno Desthuilliers bruno.42.desthuilliers at wtf.websiteburo.oops.com
Wed Sep 12 07:30:14 EDT 2007


neoedmund a écrit :
> On Sep 7, 4:07 pm, gu <pistacc... at gmail.com> wrote:
(snip pb and code)
>> now, in the second "for" cycle and in functionA() i only 'touch' copyOfA
>> (altering it). as i don't touch the variable "a", i expect it not to be
>> affected by any change, but copyOfA acts like a pointer to a and
>> altering copyOfA's values result in altering the values of "a", so the
>> result that i expect is:
(snip)
> no language act like want you tought, or the assignment operation will
> be too expensive.

IIRC, php4 was doing copies for arrays...



More information about the Python-list mailing list