micropython

tests/compare_equality.py

438:b547786f38c7
2011-07-02 Paul Boddie Moved some code generation methods into a new Assembler class. Separated sequence element storage into a separate method which may form the basis of a native library routine.
     1 #!/usr/bin/env python     2      3 a = 1     4 b = 2     5      6 class X:     7     def __eq__(self, other):     8         return 0     9     def __ne__(self, other):    10         return 1    11     12 x = X()    13     14 result_1 = 0    15 result_2 = 2    16 result_3 = 3    17 result_4 = 0    18     19 if a != x != b:    20     result_1 = 1    21     22 if a == x != b:    23     result_2 = 0    24     25 if a == x:    26     result_3 = 0    27     28 if a != x:    29     result_4 = 4    30     31 # vim: tabstop=4 expandtab shiftwidth=4