2012-07-01 | Paul Boddie | raw annotate files changeset graph | Added support for value assignments in general attribute name declarations. Changed the handling of globals in functions to use general attribute name declarations (the assertion of a name being used in isolation) instead of attribute usage observations (where combinations of names are used to deduce more specific types). |
1 #!/usr/bin/env python 2 3 def make_add(x): 4 return lambda a, b=x: a + b 5 6 def g(f, x): 7 return f(x) 8 9 add_2 = make_add(2) 10 add_3 = make_add(3) 11 12 result_3 = add_2(1) 13 result_4 = g(add_2, 2) 14 15 result_5 = add_3(2) 16 result_6 = g(add_3, 3) 17 18 # vim: tabstop=4 expandtab shiftwidth=4