2012-05-29 | Paul Boddie | raw annotate files changeset graph | Fixed/updated instance attributes definition note. |
1 #!/usr/bin/env python 2 3 class A: 4 def f(self, x): 5 return 0 6 def g(self, y): 7 return 2 8 9 class B: 10 def g(self, z): 11 return 4 12 13 def f(x, y): # x : A, B 14 result = x.g(1) 15 while y: # x : A only 16 y = x.f(1) 17 return result 18 19 a = A() 20 b = B() 21 result_2 = f(a, 1) 22 23 # vim: tabstop=4 expandtab shiftwidth=4