micropython

Annotated tests/failure/importer_module_attribute_assignment.py

290:029ccbe64c2b
2009-11-28 Paul Boddie Added another reference.
paul@242 1
#!/usr/bin/env python
paul@242 2
paul@242 3
import imported
paul@242 4
paul@242 5
class C:            # hack: make an attribute called y known to the system
paul@242 6
    y = None        # hack: this prevents compilation errors with the statements
paul@242 7
                    # hack: below
paul@242 8
paul@242 9
n = None
paul@242 10
n = imported
paul@242 11
n.a = 1             # not detected due to reassignment of n
paul@242 12
n.y = 2             # not detected due to reassignment of n
paul@242 13
n.y = 3             # not detected due to reassignment of n
paul@242 14
paul@242 15
# vim: tabstop=4 expandtab shiftwidth=4