[Python-Dev] Namespaces (original) (raw)

Barry A. Warsaw barry@zope.com
Sat, 6 Apr 2002 00:26:37 -0500


"A" == Aahz <aahz@pythoncraft.com> writes:

A> * primary names (gotten from the lang ref), which are names in
A> the local/global/builtin namespace

A> * object names (and a module is an object ;-) AKA attributes

I'd just call these "attributes" . Okay, maybe "attribute names".

A> * computed bindings (getitem/setitem)

I'd call these "computed attributes". I don't like "computed bindings" because that sounds like you're saying that you're computing both the target of the binding and the object that is being bound (or one or the other?).

A> What do we call all three of these collectively?  I'd say that
A> I agree with MvL that computed bindings are not in fact names,

"Computed attributes" aren't bindings, but that only matters if you can tell the difference. In a normal situation, if you see "obj.foo" it may not matter that "foo" only exists by virtue of a setattr/getattr/descriptor. I'd still claim that "foo" is an attribute name because it's part of the public interface for obj, albeit perhaps a virtual attribute name.

A> and as I said in my other post, using "binding" as the
A> collective noun looks ugly when we're also using it as a verb.
A> The key is to come up with some good way of saying

A>     When rebinding a <foo> ...

Names get bound, so names get rebound. At least, that's how I think about it.

semantical-ly y'rs, -Barry