scared about refrences...
SpreadTooThin
bjobrien62 at gmail.com
Wed Nov 1 15:20:36 EST 2006
Bruno Desthuilliers wrote:
> Nick Vatamaniuc a écrit :
> (snip)
> > In Python all the primitives are copied and all other entities are
> > references.
>
> Plain wrong. There's no "primitives" (ie : primitive data types) in
> Python, only objects. And they all get passed the same way.
so..
def fn(x):
x = x + 1
print x
a = 2
fn(a)
fn(2)
Wouldn't you say that this is being passed by value rather than by
refrence?
More information about the Python-list
mailing list