tests/attributes_class_from_other_class_via_self.py | raw changeset files shortlog |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/tests/attributes_class_from_other_class_via_self.py Sun Nov 29 01:46:46 2009 +0100 1.3 @@ -0,0 +1,18 @@ 1.4 +#!/usr/bin/env python 1.5 + 1.6 +class C: 1.7 + def f(self): 1.8 + return 1 1.9 + 1.10 +class D: 1.11 + f = C.f 1.12 + 1.13 + def g(self, c): 1.14 + m = self.f 1.15 + return m(c) 1.16 + 1.17 +c = C() 1.18 +d = D() 1.19 +result_1 = d.g(c) 1.20 + 1.21 +# vim: tabstop=4 expandtab shiftwidth=4