[Python-Dev] Decorators are function/method subclassing technique?

Roman Suzi rnd at onego.ru
Sun Aug 15 11:00:32 CEST 2004


After considering the docstring problem of decorators, it occured to me
that decorators could be seen as an inheritance mechanism of functions.

class docsafe(function):
   ...

@ docsafe
def f(x, y, z):
   """ To be saved """
   ...


print f
<__main__.docsafe object at 0x401e074c>


Sincerely yours, Roman Suzi
-- 
rnd at onego.ru =\= My AI powered by GNU/Linux RedHat 7.3


More information about the Python-Dev mailing list