[Python-Dev] Namespaces
Barry A. Warsaw
barry@zope.com
Fri, 5 Apr 2002 21:31:35 -0500
>>>>> "JH" == Jeremy Hylton <jeremy@zope.com> writes:
JH> I don't think that setting or getting an attribute is a name
JH> binding operation.
I'm curious why setting an attribute isn't a name binding operation?
Are you binding the object to the attribute name in the object's
attribute namespace? Since that maps to a setting in an __dict__
(usually), what /would/ you call it?
>>>>> "A" == Aahz <aahz@pythoncraft.com> writes:
A> Maybe yes and maybe no -- we'll argue about that later. But do
A> you agree that it's still a binding operation of some sort?
Certainly a setter is, although we could argue about the getter
(ignoring getters with side-effects).
A> If so, what's the generic term for all possible things that can
A> be bound *from*? (They bind to objects, of course.)
I'm sure I don't follow. :)
I'd say that a binding operation is that which binds an object to a
name in a particular namespace. But I'd want to prefix the term
"namespace" with an adjective to be precise. An object's attribute
namespace, a module's namespace, etc.
-Barry