Pass by reference ?
dan at cgsoftware.com
Thu Apr 6 01:48:27 CEST 2000
> def Nuke(w):
> print w,
> print w
Sorry, this function is not a good demonstration.
w is a reference to whatever is passed in.
Then you are making w a reference to None.
What you should try is w.append(5), or something
Now, let's call this:
Then, if you print x, you'll see:
Thus, we passed it by reference, because it modified the original.
> This behavior meets the classical definition of "Pass By Value".
> What other tests have I omitted, and what do they yield?
More information about the Python-list