1 #!/usr/bin/env python 2 3 class B: 4 def f(self): 5 print self 6 7 def f(self): 8 print self 9 10 class A: 11 f0 = f 12 13 b = B() 14 15 # on A on a context on A attribute context on a attribute 16 A.f0 # unbound bound (a) A (need A instance) a 17 A.f1 = f # unbound bound (a) A (need A instance) a 18 A.f2 = B.f # unbound unbound B (need B instance) B (need B instance) 19 A.f3 = b.f # bound (b) bound (b) b b 20 a = A() 21 a.f4 = f # N/A function N/A none 22 a.f5 = B.f # N/A unbound N/A B (need B instance) 23 a.f6 = b.f # N/A bound (b) N/A b 24 25 # vim: tabstop=4 expandtab shiftwidth=4