Are decorators really that different from metaclasses...
Mon Aug 30 02:49:55 CEST 2004
Paul Morrow <pm_mon at yahoo.com> writes:
> I believe that we should think of assignments to __xxx__ attributes as
> not being part of the function's body, but instead part of its
> declaration, just as we do with its docstring.
> def circum(diameter):
> """This describe's foo."""
> __author__ = 'Paul Morrow'
> __version__ = '0.1'
That's fundamentally a pretty good idea, but conflicts with how we
currently use __xxx__ attributes:
def fcn(self, x, y, r):
__init__ = fcn
should work about the same way as
def __init__(self, x, y, r):
... # same function as fcn above
More information about the Python-list