On Jan 16, 2008 7:58 AM, <[EMAIL PROTECTED]> wrote: > On Jan 16, 1:21 pm, "Neil Cerutti" <[EMAIL PROTECTED]> wrote: > > In the following function, a is rebound with an assignment statement, > > while b is mutated, i.e., changed, with an assignment statement. > > > > def f(a, b): > > a = 12 > > b.value = 14 > > > > Argument a will never be changed, while argument b will be. Python's > > argument passing semantics are extremely simple. It's the assignment > > statement that's tricky: some assignments mutate/change objects, and > > some only rebind names. > > So basically the scope is the reason for confusion a lot of the time?
No, my hypothesis is that Python's assignment statement semantics are the tricky part--once you understand them, the utter simplicity of Python's argument passing semantics will be evident. -- Neil Cerutti <[EMAIL PROTECTED]> -- http://mail.python.org/mailman/listinfo/python-list