micropython

Annotated tests/lambda_defaults.py

655:c52c50dca9dc
2013-05-01 Paul Boddie Added some tests of dynamic attribute access using getattr and string constants. syspython-as-target
paul@234 1
#!/usr/bin/env python
paul@234 2
paul@234 3
add_2 = lambda a, b=2: a + b
paul@234 4
paul@234 5
def g(f, x):
paul@234 6
    return f(x)
paul@234 7
paul@234 8
result_3 = add_2(1)
paul@234 9
result2_3 = g(add_2, 1)
paul@234 10
paul@234 11
# vim: tabstop=4 expandtab shiftwidth=4