Neil Cerutti <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]: 

> On 2007-07-24, Alex Popescu <[EMAIL PROTECTED]> wrote:
>> Bruno Desthuilliers <[EMAIL PROTECTED]>
>> wrote in news:[EMAIL PROTECTED]:
>>
>
> [snip...]
>
>>
>> class MyClass(object):
>>   class_list = ['a', 'b']
>>
>>   def instance_method(self):
>>     print "instance_method with class list %s" % class_list
> 
> There's no implicit self or class for Python identifiers.
> 
> The name class_list must be quailified: self.class_list or
> MyClass.class_list.
> 

After more investigation I have figured this out by myself, but thanks for 
the details.
Now I am wondering if in the above case there is a prefered way:
MyClass.class_list or self.__class__.class_list? (IMO the 2nd is more safe 
in terms of refactorings).

./alex
--
.w( the_mindstorm )p.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to