Re: scope of function parameters
- From: Ben Finney <ben+python@xxxxxxxxxxxxxxx>
- Date: Mon, 30 May 2011 07:42:19 +1000
Peter Pearson <ppearson@xxxxxxxxxxxxxxx> writes:
Python works in terms of objects having names, and one
object can have many names.
Or no names. So it's less accurate (though better than talking of
“variables”) to speak of Python objects “having names”.
The names b and c aren't boxes that hold things, they are -- in the
words of one of this group's old hands -- sticky-note labels that have
been slapped on the same object.
Right. And in that analogy, the object *still* doesn't “have a name”
(since that implies the false conclusion that the object knows its own
name); rather, the name is bound to the object, and the object is
oblivious of this.
I prefer to talk not of sticky notes, but paper tags with string; the
string leading from tag to object is an important part, and the paper
tag might not even have a name written on it, allowing the same analogy
to work for other non-name references like list indices etc.
--
\ “Pinky, are you pondering what I'm pondering?” “I think so, |
`\ Brain, but where are we going to find a duck and a hose at this |
_o__) hour?” —_Pinky and The Brain_ |
Ben Finney
.
- Follow-Ups:
- Re: scope of function parameters
- From: Laurent Claessens
- Re: scope of function parameters
- References:
- scope of function parameters
- From: Henry Olders
- Re: scope of function parameters
- From: Peter Pearson
- scope of function parameters
- Prev by Date: How to Use Setuptools, Alternatives?
- Next by Date: Re: English Idiom in Unix: Directory Recursively
- Previous by thread: Re: scope of function parameters
- Next by thread: Re: scope of function parameters
- Index(es):
Relevant Pages
|