[Python-Dev] Decorators are function/method subclassing technique? (original) (raw)
Roman Suzi rnd at onego.ru
Sun Aug 15 11:00:32 CEST 2004
- Previous message: [Python-Dev] Decorators and docstrings
- Next message: [Python-Dev] Deprecate sys.exitfunc?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: [Python-Dev] Decorators and docstrings
- Next message: [Python-Dev] Deprecate sys.exitfunc?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]