Bruno Desthuilliers a écrit :
> Georg Brandl a écrit :
(snip)
>>
>> That's another sign that property isn't intended to be used as a 
>> decorator.
>> Normally, decorators wrap functions with other functions.
> 
> 
> Normally, decorators take a function and return anything appropriate.
 >
>> property doesn't
>> return a function but a descriptor object.

So do classmethod.

 >>> classmethod(fun).__get__
<method-wrapper object at 0x4041e1ec>
 >>>
 >>> classmethod(fun)()
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
TypeError: 'classmethod' object is not callable
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to