1.1 --- a/tests/methods.py Fri Feb 20 01:24:14 2009 +0100
1.2 +++ b/tests/methods.py Sun Feb 22 02:03:17 2009 +0100
1.3 @@ -1,13 +1,11 @@
1.4 #!/usr/bin/env python
1.5
1.6 -def f(x):
1.7 - pass
1.8 -
1.9 class B:
1.10 def f(self):
1.11 pass
1.12
1.13 - Bf = f # context == parent
1.14 +def f(self):
1.15 + pass
1.16
1.17 b = B()
1.18
1.19 @@ -16,7 +14,6 @@
1.20 f1 = f # unbound (A) bound (a)
1.21 f2 = B.f # unbound (B) unbound (B)
1.22 f3 = b.f # bound (b) bound (b)
1.23 - Bf = B.Bf # unbound (B) unbound (B)
1.24
1.25 def __init__(self):
1.26 self.f4 = f # N/A function
1.27 @@ -24,14 +21,15 @@
1.28 self.f6 = b.f # N/A bound (b)
1.29
1.30 def m(self):
1.31 - self.f1
1.32 - self.f2
1.33 - self.f3
1.34 - self.f4
1.35 - self.f5
1.36 - self.f6
1.37 + x = self.f1 # should use optimised attribute access
1.38 + x = self.f2
1.39 + x = self.f3
1.40 + x = self.f4
1.41 + x = self.f5
1.42 + x = self.f6
1.43
1.44 a = A()
1.45 +a.m()
1.46
1.47 A.f1
1.48 A.f2