LEFT | RIGHT |
1 """Tests for binary operators on subtypes of built-in types.""" | 1 """Tests for binary operators on subtypes of built-in types.""" |
2 | 2 |
3 import unittest | 3 import unittest |
4 from test import support | 4 from test import support |
5 from operator import eq, ne, lt, gt, le, ge | 5 from operator import eq, ne, lt, gt, le, ge |
6 | 6 |
7 def gcd(a, b): | 7 def gcd(a, b): |
8 """Greatest common divisor using Euclid's algorithm.""" | 8 """Greatest common divisor using Euclid's algorithm.""" |
9 while a: | 9 while a: |
10 a, b = b%a, a | 10 a, b = b%a, a |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 self.assertEqual(op_sequence(le, A, B), ['A.__le__', 'B.__ge__']) | 371 self.assertEqual(op_sequence(le, A, B), ['A.__le__', 'B.__ge__']) |
372 self.assertEqual(op_sequence(le, B, A), ['B.__le__', 'A.__ge__']) | 372 self.assertEqual(op_sequence(le, B, A), ['B.__le__', 'A.__ge__']) |
373 self.assertEqual(op_sequence(le, B, C), ['C.__ge__', 'B.__le__']) | 373 self.assertEqual(op_sequence(le, B, C), ['C.__ge__', 'B.__le__']) |
374 self.assertEqual(op_sequence(le, C, B), ['C.__le__', 'B.__ge__']) | 374 self.assertEqual(op_sequence(le, C, B), ['C.__le__', 'B.__ge__']) |
375 | 375 |
376 def test_main(): | 376 def test_main(): |
377 support.run_unittest(RatTestCase, OperationOrderTests) | 377 support.run_unittest(RatTestCase, OperationOrderTests) |
378 | 378 |
379 if __name__ == "__main__": | 379 if __name__ == "__main__": |
380 test_main() | 380 test_main() |
LEFT | RIGHT |