object.__ne__() should allow reflected __ne__() to be tried
(self)
| 52 | self.assertIs(a != c, True) |
| 53 | |
| 54 | def test_ne_high_priority(self): |
| 55 | """object.__ne__() should allow reflected __ne__() to be tried""" |
| 56 | calls = [] |
| 57 | class Left: |
| 58 | # Inherits object.__ne__() |
| 59 | def __eq__(*args): |
| 60 | calls.append('Left.__eq__') |
| 61 | return NotImplemented |
| 62 | class Right: |
| 63 | def __eq__(*args): |
| 64 | calls.append('Right.__eq__') |
| 65 | return NotImplemented |
| 66 | def __ne__(*args): |
| 67 | calls.append('Right.__ne__') |
| 68 | return NotImplemented |
| 69 | Left() != Right() |
| 70 | self.assertSequenceEqual(calls, ['Left.__eq__', 'Right.__ne__']) |
| 71 | |
| 72 | def test_ne_low_priority(self): |
| 73 | """object.__ne__() should not invoke reflected __eq__()""" |
nothing calls this directly
no test coverage detected