micropython

Annotated tests/compare_membership.py

501:0d0cb0b43c38
2012-05-11 Paul Boddie Added support for loading submodules given as imported names in "from" statements (such as "module" in "from imported_package import module" referring to "imported_package.module").
paul@232 1
#!/usr/bin/env python
paul@232 2
paul@232 3
a = 1
paul@232 4
paul@232 5
class X:
paul@232 6
    def __contains__(self, other):
paul@232 7
        return 1
paul@232 8
paul@232 9
x = X()
paul@232 10
paul@232 11
result_5 = 0
paul@232 12
result_6 = 6
paul@232 13
paul@232 14
if a in x:
paul@232 15
    result_5 = 5
paul@232 16
paul@232 17
if a not in x:
paul@232 18
    result_6 = 0
paul@232 19
paul@232 20
# vim: tabstop=4 expandtab shiftwidth=4