You could use self.__class__.X

HTH, Ole


23 Sep 2005 14:01:21 -0700, Carlos <[EMAIL PROTECTED]>:
> Hi!
>
> class A:
>   X = 2
>   def F():
>     print A.X
>   F()
>
> The above fails because the name A is not
> yet at global scope when the reference A.X
> is reached. Is there any way to refer to A.X
> without making explicit use of the name 'A'?
> Admittedly the code looks pretty unusual,
> but I'm defining configuration "minilanguages"
> to configure different parts of an application,
> each inside a configuration class (like A),
> and I find this very convenient except for
> the above problem.
>
> Thank you in advance
> Regards,
> Carlos
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to