2009-05-23 | Paul Boddie | file changeset files shortlog | Added callable context vs. self argument validation in CheckFrame, plus a test which detects an attempt to fake the self argument with an incompatible instance. |
paul@219 | 1 | #!/usr/bin/env python |
paul@219 | 2 | |
paul@219 | 3 | class C: |
paul@219 | 4 | clsattr = 123 |
paul@219 | 5 | clsattr2 = 456 |
paul@219 | 6 | |
paul@219 | 7 | def f(self): |
paul@219 | 8 | return C.clsattr |
paul@219 | 9 | |
paul@219 | 10 | def g(self): |
paul@219 | 11 | return self.clsattr2 |
paul@219 | 12 | |
paul@219 | 13 | c = C() |
paul@219 | 14 | a = c.f() |
paul@219 | 15 | b = c.g() |
paul@219 | 16 | |
paul@219 | 17 | # vim: tabstop=4 expandtab shiftwidth=4 |