2012-05-10 | Paul Boddie | file changeset files shortlog | Changed the builtins module loading to use the module search path. This makes it easier to run the test program from another location. Added a note about relative imports. |
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 |