micropython

tests/lambda_defaults_non_constant.py

438:b547786f38c7
2011-07-02 Paul Boddie Moved some code generation methods into a new Assembler class. Separated sequence element storage into a separate method which may form the basis of a native library routine.
     1 #!/usr/bin/env python     2      3 x = 1     4 x = 2     5      6 def make_add():     7     return lambda a, b=x: a + x     8      9 def g(f, x):    10     return f(x)    11     12 add_2 = make_add()    13 result_3 = add_2(1)    14 result2_3 = g(add_2, 1)    15     16 # vim: tabstop=4 expandtab shiftwidth=4