Decorator help

Steven D'Aprano steve+comp.lang.python at pearwood.info
Thu Mar 28 05:58:23 CET 2013


On Wed, 27 Mar 2013 22:38:11 -0400, Jason Swails wrote:

>> The second case is the easiest. Suppose you have a class like this,
>> with many methods which have code in common. Here's a toy example:
>>
>>
>> def MyClass(object):
>>     x = "class attribute"
>>
>>     def __init__(self, y):
>>         self.y = y
>>
>>
> In the spirit of nit-picking, I'll point out that Steven meant to use
> the 'class' keyword instead of 'def' for MyClass.


/face-palm


So I did. Thanks for picking the nit.




-- 
Steven



More information about the Python-list mailing list