2007-01-08 | paulb | file changeset files shortlog | Added an exception to the locally defined function names rule: within a class definition, methods should not be accessible via their plain names alone (ie. like functions). |
paulb@14 | 1 | class A: |
paulb@82 | 2 | "A class with attribute and method." |
paulb@14 | 3 | x = 123 |
paulb@14 | 4 | def m(self, x): |
paulb@14 | 5 | self.x = x |
paulb@14 | 6 | a = A() |
paulb@23 | 7 | y = A.x |
paulb@82 | 8 | a.m(321) |
paulb@23 | 9 | z = a.x |