2012-06-05 | Paul Boddie | raw annotate files changeset graph | Introduced more rigid selection of suitable types depending on whether all attributes given as being used can be found in one or more types, or whether the selection of less satisfactory types (supporting any of the attributes) is necessary. |
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