En Fri, 01 Aug 2008 23:47:42 -0300, Benjamin <[EMAIL PROTECTED]> escribió:
On Aug 1, 6:23 pm, Andrew Lentvorski <[EMAIL PROTECTED]> wrote:
How do I determine the order of definition of class attributes?

For example, if I have a class

class Test(object):
     y = 11
     x = 22

How do I tell that y was defined before x?

You wait until Python 3.0 where you can do this sort of thing with
metaclasses.

So the namespace that the metaclass receives when the class is created, will be some kind of ordered dictionary? Metaclasses are available for a long time ago, but the definition order is lost right at the start, when the class body is executed. Will this step be improved in Python 3.0 then?

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to