[Python-Dev] Re: new syntax for wrapping (PEP 318)
theller at python.net
Thu Feb 26 13:48:04 EST 2004
Christian Tismer <tismer at stackless.com> writes:
> Bob Ippolito wrote:
>>> class klass:
>>> foo = decorator
>>> def foo():...
>>> baz = decorator1, decorator2
>>> def baz(): ...
>>> The simple idea is to change semantics that if a name already
>>> exists before a def, it is checked whether it is a decorator
>>> function or a tuple of these, and if so, they are called.
>> That's too magical for me, and it means I have to spell out the name
>> of the function (which may be quite long) twice.. which is better
>> than three times, but not as good as once.
> Or even simpler, just push them as special constants on top of the def:
> class klass:
> def foo():...
> not too serious, but I hate new syntax...
The above code looks like as someone forgot to actually initialize the
class variable (probably not too likely with the name 'classmethod', but
with other names):
classmethod = 42
More information about the Python-Dev