On Wed, May 4, 2011 at 6:47 AM, Hans Georg Schaathun <h...@schaathun.net> wrote: > This looks like plain old transmission by reference to me. > I.e. the functions get a reference to an object and make any > change to the object.
"Reference" being exactly what's passed around. There are now two references to that object. Since names always contain references (not objects), it's very easy to share mutable objects (lists/dictionaries/etc). There's an easy way for a caller or callee to guarantee that a mutable is safe - just slice it: identify_call(my_list[:]) That gives the called function a shallow copy of the list, which it can modify to its heart's content, but the original list isn't changed. Callee can do the same, with an assignment command at the top of the function (a_list=a_list[:]). Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list