Jeff wrote:
When you call c3.createJoe(c1.fred), you are passing a copy of the
value stored in c1.fred to your function.  Python passes function
parameters by value.

These statements are both wrong. Function argument objects or objects derived therefrom are bound to function parameter names. One could say that Python calls by cross-namespace assignment. No copying is done, anymore than with assignment statements.

It returns objects the same way if there is a target to receive them.

>  The function will not destructively modify its arguments;

If the argument is mutable and the function calls a mutation method of the object, it is mutated.

tjr

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to