References, and avoiding use of ???variable??? (was: Can global variable be passed into Python function?)

Neil Cerutti neilc at norwich.edu
Fri Feb 28 09:30:46 EST 2014


On 2014年02月28日, Ben Finney <ben+python at benfinney.id.au> wrote:
> "Mark H. Harris" <harrismh777 at gmail.com> writes:
>> So, yeah, thinking about variables is just not going away.
>> Right. I would like, ideally, for the Python documentation to
> avoid mentioning that term entirely; and I would hope for that
> to promote a better understanding of Python's data model.
>> The wider programming community, though, will no doubt continue
> to use that term to refer to various (incompatible) data
> models, and I certainly don't expect the Python community to
> pretend it doesn't exist.

I like the characteristic of Python that assignment and argument
passing work the same way. If only C were so simple!
The tutorial makes things sound more high-falutin' than that
[Tutorial 4.6 Defining Functions]:
 The actual parameters (arguments) to a function call are
 introduced in the local symbol table of the called function
 when it is called; thus, arguments are passed using call by
 value (where the value is always an object reference, not the
 value of the object). [...]
How about:
 The actual parameters (arguments) to a function call are passed
 via assignment to the variables in the local symbol table of
 the called function. 
Am I oversimplifying?
-- 
Neil Cerutti


More information about the Python-list mailing list

AltStyle によって変換されたページ (->オリジナル) /