Any other Python flaws?

Martijn Faassen m.faassen at vet.uu.nl
Fri Jun 15 08:15:44 EDT 2001


Mattias Engdegård <f91-men at nada.kth.se> wrote:
> In <mailman.992543370.22014.python-list at python.org> Andrew Kuchling <akuchlin at mems-exchange.org> writes:
[snip]
> (by the way, your page (Python Warts) claims that python uses
> call-by-reference, which is a common misconception. Just like most other
> sensible languages (but unlike C++, Fortran, Pascal) it uses call-by-value.
> The values, however, are frequently references to objects, which is
> probably the cause of the confusion. :-)

When are the values *not* references to objects? They may be references
to immutable objects, but they'll always be references.

I agree that nobody agrees on whatever 'call-by-reference' means, or what
'call-by-value' means. I mean, I'm here confused why you'd say C++ doesn't
support call-by-value while Python apparently does. :)

Python uses references everywhere; you can't pass anything but references,
assignment is reference rebinding, the only way you ever get to objects
is through references. This is good and as it should be in Python. Let's
not go into a discussion on whatever call-by-foo means, as nobody could
agree last time around. 

Regards,

Martijn
-- 
History of the 20th Century: WW1, WW2, WW3?
No, WWW -- Could we be going in the right direction?



More information about the Python-list mailing list