micropython

tests/compare_membership.py

442:13aae946513b
2011-07-05 Paul Boddie Introduced Instance() in place of None as a result and for the value of the active expression where no definitive object can be deduced. Made all Instance values compare equal to each other in order to avoid duplication in sets. Improved Constant comparisons. Fixed assignment counting where many values are provided in a single assignment. Added inspection support for conditional expressions (since they are used in the standard library).
     1 #!/usr/bin/env python     2      3 a = 1     4      5 class X:     6     def __contains__(self, other):     7         return 1     8      9 x = X()    10     11 result_5 = 0    12 result_6 = 6    13     14 if a in x:    15     result_5 = 5    16     17 if a not in x:    18     result_6 = 0    19     20 # vim: tabstop=4 expandtab shiftwidth=4