Find class attributes creation order

Marcob marcoberi at gmail.com
Mon Jun 23 17:53:07 CEST 2008


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?

Thanks for your time.

Ciao.
Marco.



More information about the Python-list mailing list