Scope of instantiated class

Aahz aahz at pythoncraft.com
Tue Jul 23 16:52:48 EDT 2002


In article <3D3B4F80.B0D6BE07 at engcorp.com>,
Peter Hansen  <peter at engcorp.com> wrote:
>Alex Martelli wrote:
>> Peter:
>>>
>>> the name you use is local to the function, then when
>>> the function exits the binding is removed and the object,
>>> if no other names are by now bound to it, is destroyed.
>> 
>> Yes, except that 'names' must be used in a very wide
>> sense here -- e.g., async.dispatcher instances are kept
>> alive by references to them in the socket_map dict,
>> which are "names" only in a very wide sense.
>
>I'm trying to follow Aahz' advice and avoid "reference" in favour of
>"binding" etc, but I guess I carried it too far! :)

<grin>  Your problem wasn't in your use of "binding", but in your use of
"name; I use "target" to refer to the general case of thingy that can
contain a binding, of which names are a subset.  "Names" are words
attached to a namespace (i.e. function local, module global, builtin, or
object attribute).  Another target is an index/key for container
objects.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

Project Vote Smart: http://www.vote-smart.org/



More information about the Python-list mailing list