micropython

Annotated tests/op_add_default.py

634:c1c95a183e21
2013-01-14 Paul Boddie Moved common logic into a separate method.
paul@187 1
#!/usr/bin/env python
paul@187 2
paul@338 3
a = 10 # used in f default
paul@338 4
b = 20 # used in f default
paul@338 5
paul@187 6
def f(a, b, c=a+b):
paul@187 7
    return a + b + c
paul@187 8
paul@246 9
result_33 = f(1, 2)
paul@187 10
paul@187 11
# vim: tabstop=4 expandtab shiftwidth=4