1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/tests/attributes4.py Sun Sep 28 21:42:03 2008 +0200
1.3 @@ -0,0 +1,40 @@
1.4 +#!/usr/bin/env python
1.5 +
1.6 +class C:
1.7 + def h(self):
1.8 + self.m = self.f
1.9 + return self.m # not known
1.10 + def f(self): pass
1.11 +
1.12 + def test(self):
1.13 + self.f()
1.14 + self.h()
1.15 +
1.16 +class D:
1.17 + f = C.f
1.18 + def h(self):
1.19 + self.m = self.f
1.20 + return self.m # not known
1.21 +
1.22 + def test(self):
1.23 + self.f(2)
1.24 + self.h()
1.25 +
1.26 +class E(C):
1.27 + def h(self):
1.28 + self.m = self.f
1.29 + return self.m # not known
1.30 +
1.31 + def test(self):
1.32 + self.f()
1.33 + self.h()
1.34 +
1.35 +c = C()
1.36 +d = D()
1.37 +e = E()
1.38 +
1.39 +x = c.f # bound C.f == c.h()
1.40 +y = d.f # unbound C.f == d.h()
1.41 +z = e.f # bound E.f == e.h()
1.42 +
1.43 +# vim: tabstop=4 expandtab shiftwidth=4