micropython

Annotated tests/failure/shadow_class_global_reassign.py

432:1964e5898e68
2011-06-14 Paul Boddie Fixed negation of operator method results in other operator methods. Added NotImplementedType as an automatically generated class.
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