Ticket #16537: rich-comparison-python-3.4.0.txt

File rich-comparison-python-3.4.0.txt, 2.9 KB (added by wluebbe, 8 years ago)
Line 
1File "/home/wluebbe/python-scripts/rich-cmp-comparison-1.py", line 46, in <module>
2  cmp_t = eval('t1'+op+'t2')
3File "/home/wluebbe/python-scripts/<string>", line 1, in <module>
4File "/home/wluebbe/python-scripts/rich-cmp-comparison-1.py", line 22, in __eq__
5  return cmp(self.val, other.val) == 0
6
7builtins.NameError: name 'cmp' is not defined
8
9
103.4.0 (default, Apr 11 2014, 13:05:11)
11[GCC 4.8.2]
12==================================================
13case= own_cmp, total= True
14t1= TestClass(val=a), id= 140240573649920
15t2= TestClass(val=a), id= 140240573649976
16
17t1==t2: True      (val: True ; id: False) OK
18t1!=t2: False     (val: False; id: True ) OK
19t1< t2: False     (val: False; id: True ) OK
20t1<=t2: True      (val: True ; id: True ) OK
21t1> t2: False     (val: False; id: False) OK
22t1>=t2: True      (val: True ; id: False) OK
23--------------------------------------------------
24t1= TestClass(val=a), id= 140240573650088
25t2= TestClass(val=b), id= 140240573649920
26
27t1==t2: False     (val: False; id: False) OK
28t1!=t2: True      (val: True ; id: True ) OK
29t1< t2: True      (val: True ; id: False) OK
30t1<=t2: True      (val: True ; id: False) OK
31t1> t2: False     (val: False; id: True ) OK
32t1>=t2: False     (val: False; id: True ) OK
33--------------------------------------------------
34t1= TestClass(val=b), id= 140240573649976
35t2= TestClass(val=a), id= 140240573650088
36
37t1==t2: False     (val: False; id: False) OK
38t1!=t2: True      (val: True ; id: True ) OK
39t1< t2: False     (val: False; id: True ) OK
40t1<=t2: False     (val: False; id: True ) OK
41t1> t2: True      (val: True ; id: False) OK
42t1>=t2: True      (val: True ; id: False) OK
43--------------------------------------------------
44==================================================
45case= own_cmp, total= False
46t1= TestClass(val=a), id= 140240573649920
47t2= TestClass(val=a), id= 140240573649976
48
49t1==t2: True      (val: True ; id: False) OK
50t1!=t2: False     (val: False; id: True ) OK
51t1< t2: False     (val: False; id: True ) OK
52t1<=t2: TypeError (val: True ; id: True )
53t1> t2: False     (val: False; id: False) OK
54t1>=t2: TypeError (val: True ; id: False)
55--------------------------------------------------
56t1= TestClass(val=a), id= 140240573650144
57t2= TestClass(val=b), id= 140240573649920
58
59t1==t2: False     (val: False; id: False) OK
60t1!=t2: True      (val: True ; id: True ) OK
61t1< t2: True      (val: True ; id: False) OK
62t1<=t2: TypeError (val: True ; id: False)
63t1> t2: False     (val: False; id: True ) OK
64t1>=t2: TypeError (val: False; id: True )
65--------------------------------------------------
66t1= TestClass(val=b), id= 140240573649976
67t2= TestClass(val=a), id= 140240573650144
68
69t1==t2: False     (val: False; id: False) OK
70t1!=t2: True      (val: True ; id: True ) OK
71t1< t2: False     (val: False; id: True ) OK
72t1<=t2: TypeError (val: False; id: True )
73t1> t2: True      (val: True ; id: False) OK
74t1>=t2: TypeError (val: True ; id: False)
75--------------------------------------------------
76