2016-11-23 | Paul Boddie | file changeset files shortlog | Added print statements for testing purposes. |
paul@2 | 1 | a = 4 |
paul@2 | 2 | |
paul@2 | 3 | def f(x): |
paul@43 | 4 | def g(y, x=x): |
paul@43 | 5 | def h(a, z, x=x, y=y): |
paul@43 | 6 | return x, y, z, a # parameter a overrides global scope |
paul@2 | 7 | return h |
paul@2 | 8 | return g |
paul@2 | 9 | |
paul@2 | 10 | result = f(1)(2)(5, 3) |
paul@214 | 11 | print result[0] |
paul@214 | 12 | print result[1] |
paul@214 | 13 | print result[2] |
paul@214 | 14 | print result[3] |
paul@43 | 15 | assert result == (1, 2, 3, 5) |