function parameter scope python 2.5.2

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Thu Nov 20 23:34:42 EST 2008


On Thu, 20 Nov 2008 18:31:12 -0500, J Kenneth King wrote:

> Of course I expected that recursive_func() would receive a copy of
> weird_obj.words but it appears to happily modify the object.

I am curious why you thought that. What made you think Python should/did 
make a copy of weird_obj.words when you pass it to a function?

This is a serious question, I'm not trying to trap you into something :)


-- 
Steven



More information about the Python-list mailing list