Passing by value instead of reference
jmassung at magpiesystems.com
Wed May 10 20:51:13 CEST 2000
Michael Hudson wrote in message ...
>"Jeff Massung" <jmassung at magpiesystems.com> writes:
>> >>> z=5
>> >>> id(z)
>> >>> def test(x):
>> print id(x)
>> >>> test(z)
>> Is there a way to pass the value of z and not the address? Thanks.
>Then what would you expect your "test" function to do?
Just print a different address. If test was:
I would want this to print the original value of z (5), not 1.
More information about the Python-list