tests/nested_functions.py | raw changeset files shortlog |
1.1 --- a/tests/nested_functions.py Sun Jan 07 23:44:39 2007 +0100 1.2 +++ b/tests/nested_functions.py Mon Jan 08 23:37:53 2007 +0100 1.3 @@ -1,3 +1,14 @@ 1.4 +class C: 1.5 + def f(self): 1.6 + return f 1.7 + 1.8 + def f2(self): 1.9 + def g2(x): 1.10 + if x <= 0: 1.11 + return x 1.12 + return g2(x - 1) + x 1.13 + return g2 1.14 + 1.15 def f(): 1.16 def g(x): 1.17 if x <= 0: 1.18 @@ -7,3 +18,7 @@ 1.19 1.20 a = f() 1.21 b = a(3) 1.22 +c = C() 1.23 +c.f() 1.24 +d = c.f2() 1.25 +e = d(3)