[issue7867] Proposed FAQ entry on pass-by-? semantics and the meaning of 'variable' in python

Terry J. Reedy report at bugs.python.org
Sun Jul 11 01:23:43 CEST 2010


Terry J. Reedy <tjreedy at udel.edu> added the comment:

I and others completely disagree with "Technically the correct answer is 'pass by value',". This confuses the C implementation with the abstract semantics of Python. The correct answer is neither. Nothing is 'passed'.

A better form of the question would be "Does Python use call-by-value or call-by-reference?" The answer would still be 'neither'. Python is different from Fortran, C, and the other languages to which those terms apply. And because both are wrong, both lead to wrong expectations.

Python binds argument objects to parameter names in the function's local namespace. This is 'call by object', the term used by Barbara Liskov, chief developer of the object-based CLU language that did the same long before Python. I would call *that* the 'technically correct answer.

Yes, this has been very controversial on python-list.

----------
nosy: +tjreedy

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7867>
_______________________________________


More information about the Python-bugs-list mailing list