Passing arguments to function - (The fundamentals are confusingme)
tjreedy at udel.edu
Wed Aug 10 06:43:51 CEST 2005
"Gregory Piñero" <gregpinero at gmail.com> wrote in message
news:312cfe2b05080909324b1929db at mail.gmail.com...
>Ahh, so it's a mutable thing. That makes sense that I can't change a
>mutable object and thus can't affect it outside of the function.
You of course meant immutable, but this is still confused. It is a
name-binding versus object mutation thing.
> Does that mean Python functions aren't always byref,
> but are sometimes byval for nonmutables?
No, neither. Python functions calls are always by name binding. See my
first response. You are only about the 1000th or maybe 10000th person
confused by trying to apply inapplicable concepts to Python.
Terry J. Reedy
More information about the Python-list