SpreadTooThin schrieb:
> 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?

It appears so, but it still is a truth - all objects, even the numbers, 
are objects. No copying.

Diez
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to