micropython

tests/failure/outer_stupid.py

803:39ba98ecc020
2014-06-01 Paul Boddie Fixed a docstring to describe the method's actual return value. syspython-as-target
     1 #!/usr/bin/env python     2      3 "Inspired by difflib._mdiff._line_iterator and its from_line variable."     4      5 def outer():     6     def inner(x):     7         if x:     8             y = 1       9         return y    10     y = 2    11     return inner    12     13 result_1 = outer()(1)    14 result_2 = outer()(0) # CPython fails with UnboundLocalError in inner    15     16 # vim: tabstop=4 expandtab shiftwidth=4