Access class from staticmethod

Thomas Allen thomasmallen at gmail.com
Fri Apr 30 21:52:12 CEST 2010


Ah ha, @classmethod.

On Apr 30, 3:47 pm, Thomas Allen <thomasmal... at gmail.com> wrote:
> Is that possible?
>
> class A(object):
>   @staticmethod
>   def set_b(x):
>     # A.b = x, without knowing A is "A"
>     pass
>
> Thomas




More information about the Python-list mailing list