Jason E. Sibre wrote: > > [Is the horse still breathing?] > > Along those lines, here's another idea for a helper class that makes the > concept of putting stuff in _q_exports possible, this time with no > modifications to Qx at all (except possibly making the helper class > available somewhere). Oooo and ONE MORE! Let's hear it for Metaclasses! class QExportType(type): def __new__(metacls, name, bases, dictionary): q_map = dictionary.get('_q_map') # if we have a _q_map entry then we add the keys to the _q_exports # list so the Publisher can find them and we'll stuff the _q_map # key/values into the dictionary so we don't need a _q_resolve if q_map: dictionary.setdefault('_q_exports', []).extend(q_map.keys()) dictionary.update(q_map) return super(QExportType, metacls).__new__(metacls, name, bases, dictionary) class Mod1(object): __metaclass__ = QExportType import foo, bar, twenty_bar, twelve_foo _q_exports = ['foo', 'bar'] _q_map = {'20bar': twenty_bar, '12foo': twelve_foo, } def __call__(self, request): return 'in __call__' def _q_index(self, request): return 'in _q_index' class Mod2(object): __metaclass__ = QExportType import foo, bar _q_exports = ['foo', 'bar'] def __call__(self, request): return 'in __call__' def _q_index(self, request): return 'in _q_index' I-wish-modules-could-have-a-metaclass.-ly yours Tom