Find class attributes creation order

Michele Simionato michele.simionato at
Mon Jun 23 12:53:38 EDT 2008

On Jun 23, 5:53 pm, Marcob <marcob... at> wrote:
> Let's see these simple classes:
>     class base_foo()
>          pass
>     class foo(base_foo):
>          a=1
>          b={}
>          c="zz"
> I would like to find class foo attributes creation order.
> Using __metaclass__ is not of help because special method __new__
> receive attrs as a dictionary and so the order isn't preserved. Any
> other idea?

You need to wait for Python 3.0 metaclasses: which
you should know already (ciao Marco! ;-)

   Michele Simionato

More information about the Python-list mailing list