Hello I stumpled upon this "feature" during my work tonight, and found it a bit confusing:
>>> class A(object): ... class C: ... foobar = 42 ... >>> class B(A): pass ... >>> A.C <class __main__.C at 0xb7cf735c> >>> B.C <class __main__.C at 0xb7cf735c> >>> B.C.foobar = 60 >>> A.C.foobar 60 When I inherit B from A, I would expect that A.C and B.C would be two different classes? But apparently not. Can anyone give me an explanation? Or a better workaround than something along the line of: >>> B.C = type("C", (object,), {'foobar': 60}) Instead of: >>> B.C.foobar = 60 Thanks, -- Christian Joergensen | Linux, programming or web consultancy http://www.razor.dk | Visit us at: http://www.gmta.info -- http://mail.python.org/mailman/listinfo/python-list