2007-09-06 | Paul Boddie | file changeset files shortlog | Added a fully-qualified name method for WithName-derived classes, producing a more usable global name for applications such as the viewer. Added a method for returning "visible" class attributes to GeneralClass. Added an attribute table production function for integration with the explicit distribution, along with a test program option for generating such a table. |
paulb@170 | 1 | class A: |
paulb@170 | 2 | __x = 3 |
paulb@170 | 3 | def f(self): |
paulb@170 | 4 | print self.__x |
paulb@170 | 5 | |
paulb@170 | 6 | class B(A): |
paulb@170 | 7 | __x = 4 |
paulb@170 | 8 | |
paulb@170 | 9 | class C(B): |
paulb@170 | 10 | __x = 5 |
paulb@170 | 11 | def f(self): |
paulb@170 | 12 | print self.__x |
paulb@170 | 13 | |
paulb@170 | 14 | a = A() |
paulb@170 | 15 | a.f() |
paulb@170 | 16 | b = B() |
paulb@170 | 17 | b.f() |
paulb@170 | 18 | c = C() |
paulb@170 | 19 | c.f() |