[Python-Dev] Re: new syntax for wrapping (PEP 318)

Bob Ippolito bob at redivi.com
Thu Feb 26 13:11:58 EST 2004


On Feb 26, 2004, at 1:00 PM, Christian Tismer wrote:

> 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:
>   classmethod
>   def foo():...
>
> not too serious, but I hate new syntax...

Try writing large portions of code that are just begging for this new 
syntax!
Try writing large portions of code that are just begging for this new 
syntax!
Try writing large portions of code that are just begging for this new 
syntax!
(three times, to emphasize the number of times that I have to type the 
name of each function when using a descriptor)
(three times, to emphasize the number of times that I have to type the 
name of each function when using a descriptor)
(three times, to emphasize the number of times that I have to type the 
name of each function when using a descriptor)

The special pushed constants thing is just a little too weird for me as 
well :)

-bob




More information about the Python-Dev mailing list