micropython

tests/compare_membership.py

240:c93dcf98ca1b
2009-06-07 Paul Boddie Changed the code body location initialisation in the code generation activity to set either a specific location or a symbolic reference to a native function or class (employing an instantiator). Fixed the "for" loop iterator storage and exception handling. Made xrange raise a StopIteration instance, short of adding class detection into RaiseException. Made code generation produce instantiators for StopIteration and BaseException, with the latter also providing attribute/size information in the builtins module. Added more integer operations in the RSVP implementation.
     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