Metaclasses and class variables

Jan-Ole Esleben esleben at
Thu Aug 4 15:54:10 CEST 2005

Yes, that works, but it is unfortunately not an option (at least not a
good one).

Is there no way to create a class variable that exists during
definition of the class? (I cannot imagine there isn't, since
technically it's possible and manually it can be done...)


> classvar is defined AFTER the class has been created.  So, this should
> work:
> class Test:
>     __metaclass__ = Meta
> Test.classvar.append(1)
> Thomas
> --

More information about the Python-list mailing list