References, and avoiding use of ???variable???
ben+python at benfinney.id.au
Sat Mar 1 00:33:27 CET 2014
Neil Cerutti <neilc at norwich.edu> writes:
> On 2014-02-28, Ben Finney <ben+python at benfinney.id.au> wrote:
> > 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.
> I like the characteristic of Python that assignment and argument
> passing work the same way.
Yes. They both work by binding a name to a value.
> 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?
As you can see by what you quoted from me above, I think the use of
“variable” here is unnecessarily confusing.
That whole chapter of the tutorial talks about “variable” and “variable
assignment”, when IMO it should avoid those terms and use the clearer
terminology of “reference”, “name”, and “binding a name to a value”.
(Why don't I submit these documentation changes myself? That's a matter
for a separate thread.)
\ “All my life I've had one dream: to achieve my many goals.” |
`\ —Homer, _The Simpsons_ |
More information about the Python-list