properties + types, implementing meta-class desciptors elegantly?
Aahz
aahz at pythoncraft.com
Sun Jul 20 09:39:51 EDT 2003
In article <mailman.1058654317.6488.python-list at python.org>,
Mike C. Fletcher <mcfletch at rogers.com> wrote:
>
> * finally, stores the value
> o tries to do what would have been done if there were no
> descriptor (with the new, coerced value)
> o does *not* create new names in the object's namespace (all
> names are documented w/ descriptors, there's not a lot of
> '_' prefixed names cluttering the namespace)
> o does *not* require a new dictionary/storage-object attribute
> for the object (the descriptor works like any other
> descriptor, a *stand-alone* object that replaces a regular
> attribute)
But this is a recipe for name clashes. If you follow the first bullet,
it's a normal attribute, but everything else says you want a property.
Properties are themselves objects that are attached to names in an
object. You can't have the same name bound to two different objects.
--
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
This is Python. We don't care much about theory, except where it intersects
with useful practice. --Aahz
More information about the Python-list
mailing list