Scope and classes

Jan Kaliszewski zuo at chopin.edu.pl
Tue Aug 18 20:17:22 EDT 2009


19-08-2009 o 02:10:58 Jan Kaliszewski <zuo at chopin.edu.pl> wrote:

> The only ways to reach Abc's attribute 'message' from that method are:
> * 'Abc.message'
> * 'self.__class__.message'
> * 'self.message' (unless there is an instance attribute 'message' which
> overrides the class attribute).

And of course getattr(Abc), getattr(self.__class__) etc. :-)

-- 
Jan Kaliszewski (zuo) <zuo at chopin.edu.pl>



More information about the Python-list mailing list