Hi Peter,

> Plus, it works as expected (read: modifies the argument) if you
> explicitly pass an empty list to the function...

That is not so. The reason is given by Andrew Cooke in this thread.

I would "expect" that when function calls lower in the recursion 
hierarchy return, the object is not changed from the point of view of the 
higher-order calls. This is expectation is mistaken because it is "the 
same frickin object" as Andrew said. One thing that goes wrong for 
example is the last unit test given in the program.

This will happen even if an empty list is explicitly passed in the 
initial call...

Thanks to everyone for responding, this really helped me understand 
better!

Best regards, Daniel
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to