classmethod & staticmethod

Steven D'Aprano steve at REMOVE.THIS.cybersource.com.au
Wed Jul 25 21:06:37 EDT 2007


On Wed, 25 Jul 2007 00:22:18 +0000, Alex Popescu wrote:

> "Steven D'Aprano" <steve at REMOVE.THIS.cybersource.com.au> wrote in
> news:pan.2007.07.24.23.21.20.988798 at REMOVE.THIS.cybersource.com.au: 
> 
>> On Tue, 24 Jul 2007 21:35:58 +0000, Alex Popescu wrote:
>> 
>>> Neil Cerutti <horpner at yahoo.com> wrote in
>>> news:slrnfaccgl.1gk.horpner at FIAD06.norwich.edu: 
>>> 
>>>> On 2007-07-24, Alex Popescu <nospam.themindstorm at gmail.com> wrote:
>>>>> Bruno Desthuilliers
>>>>> <bruno.42.desthuilliers at wtf.websiteburo.oops.com> wrote in
>>>>> news:46a5b2ad$0$18903$426a74cc at news.free.fr: 
>>>>>
>>>>
>>>> [snip...]
>>>>
>> 
>> Use self.class_list when you want to use inheritance.
>> 
> 
> As a matter of style, how do you figure out that class_list is a class 
> attribute and not an instance attribute? (I don't remember seeing anything 
> in the PEP describing the coding style).


The whole point of inheritance is that you don't care where the attribute
is (the instance, the class, a parent class...) just that it exists.



-- 
Steven.




More information about the Python-list mailing list