Robert Dailey a écrit :
> On Jul 13, 2:10 pm, Robert Dailey <[EMAIL PROTECTED]> wrote:
> 
>>Hi,
>>
>>I noticed in Python all function parameters seem to be passed by
>>reference. 
(snip)
> 
> Correction:
> 
> I ran a few more tests and python actually does a pass by value,
(snip)

Still wrong !-)

Python passes references to objects, but the *names* are local. So while 
*mutating* (ie: calling a method that changes the state of) an object in 
a function will impact the object outside the function, *rebinding* a 
name will not impact the name outside the function.

But anyway, as Star mentionned, Ben Finney gave a pretty good (IMHO) 
explanation in the nearby thread named "understanding python functions".
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to