micropython

Annotated tests/failure/shadow_class_global_reassign.py

579:9df30d738ec1
2012-07-07 Paul Boddie Filter out __init__.py files when looking for submodule files.
paul@339 1
#!/usr/bin/env python
paul@339 2
paul@339 3
def f(self, x):
paul@339 4
    return x
paul@339 5
paul@339 6
class C:
paul@342 7
    i = 2
paul@342 8
paul@342 9
    while i > 0:
paul@342 10
        e = f # right hand side name changes origin
paul@339 11
paul@342 12
        def f(self, x):
paul@342 13
            return 3
paul@342 14
paul@342 15
        i -= 1
paul@339 16
paul@339 17
c = C()
paul@342 18
result_3 = c.f(1)
paul@339 19
paul@339 20
# vim: tabstop=4 expandtab shiftwidth=4