[Python-3000] Metaclass Vs Class Decorator

Raymond Hettinger python at rcn.com
Mon May 19 05:36:54 CEST 2008


>> It's why a want to know how to express the class decorator for making a 
>> comparison

[Georg]
> A class decorator works exactly like a function decorator, that is,
>> @foo
> class X: ...
>> is equivalent to
>> class X: ...
> X = foo(X)
>> This should be all you need to know in order to write a class decorator.

I concur.
Raymond


More information about the Python-3000 mailing list

AltStyle によって変換されたページ (->オリジナル) /