> I'm wondering as well if the new nonlocal statement will fix that in py3k?

The "class C3" statement is executing before the "class B" statement
has concluded, so at that time B does not exist in any scope at all,
not even globals(). You could reference B.C1 inside a method because a
method is executed AFTER the class is defined.
class A(object):
        pass

class B(object):

        class C1(object):
                pass

        class C2(C1):
                foo = A

        class C3(object):

            @staticmethod
            def test(  ):
                print repr( B.C1 )
                print repr( B.C2 )

B.C3.test()

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

Reply via email to