micropython

Annotated tests/globals_vs_locals.py

605:0bcb66c8b6e2
2012-07-15 Paul Boddie Show only distinct attribute name lists when showing attribute usage for names.
paul@27 1
#!/usr/bin/env python
paul@27 2
paul@27 3
b = 2
paul@27 4
paul@27 5
def f(x):
paul@246 6
    b = x
paul@27 7
paul@27 8
def g(x):
paul@27 9
    global b
paul@246 10
    b = x
paul@27 11
paul@246 12
f(3)
paul@246 13
result_2 = b
paul@246 14
g(4)
paul@246 15
result_4 = b
paul@43 16
paul@27 17
# vim: tabstop=4 expandtab shiftwidth=4