Nick Coghlan wrote:
The challenge here is how it would interact with inheritance. pydoc couldn't use normal attribute lookup, it would have to walk the MRO manually,
This is an instance of a pattern that I've encountered a few times in things that I've done: you have a class attribute containing a list of things, and you want it to be "additive" with respect to inheritance -- i.e. it contains the items specified in a particular class plus all those specified in its base classes. This can obviously be arranged using appropriate metaclass hackery, but I'm wondering whether it could be provided using some mechanism that can be applied orthogonally to any class attribute. Maybe this is another reason to have a hook somewhere in the standard class creation process that allows a descriptor to initialise itself with knowledge of its environment. -- Greg _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com