2007-03-04 | paulb | file changeset files shortlog | Silenced trace statements. |
paulb@172 | 1 | class C: |
paulb@172 | 2 | def f(self): |
paulb@172 | 3 | return f |
paulb@172 | 4 | |
paulb@172 | 5 | def f2(self): |
paulb@172 | 6 | def g2(x): |
paulb@172 | 7 | if x <= 0: |
paulb@172 | 8 | return x |
paulb@172 | 9 | return g2(x - 1) + x |
paulb@172 | 10 | return g2 |
paulb@172 | 11 | |
paulb@169 | 12 | def f(): |
paulb@169 | 13 | def g(x): |
paulb@169 | 14 | if x <= 0: |
paulb@169 | 15 | return x |
paulb@169 | 16 | return g(x - 1) + x |
paulb@169 | 17 | return g |
paulb@169 | 18 | |
paulb@169 | 19 | a = f() |
paulb@169 | 20 | b = a(3) |
paulb@172 | 21 | c = C() |
paulb@172 | 22 | c.f() |
paulb@172 | 23 | d = c.f2() |
paulb@172 | 24 | e = d(3) |