micropython

Annotated tests/compare_membership.py

605:0bcb66c8b6e2
2012-07-15 Paul Boddie Show only distinct attribute name lists when showing attribute usage for names.
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