Are decorators really that different from metaclasses...
Paul Rubin
http
Sun Aug 29 20:49:55 EDT 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):
...
class circle(shape):
__init__ = fcn
should work about the same way as
class circle(shape):
def __init__(self, x, y, r):
... # same function as fcn above
More information about the Python-list
mailing list