Paolino wrote: > Why descriptor mechanism doesn't apply to modules?
Because modules are instances of the module class and the descriptor has to be defined in the class in order to work with the instance. E. g.: >>> import sys >>> class Descr(object): ... def __get__(*args): print "__get__%r" % (args,) ... >>> module = type(sys) >>> class Module(module): ... descr = Descr() ... >>> m = Module("noname") >>> m.descr __get__(<__main__.Descr object at 0x4029372c>, <module 'noname' (built-in)>, <class '__main__.Module'>) >>> Peter -- http://mail.python.org/mailman/listinfo/python-list