File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414
1515assert not None
1616
17- assert bool () == False
18- assert bool (1 ) == True
19- assert bool ({}) == False
17+ assert bool () is False
18+ assert bool (1 ) is True
19+ assert bool ({}) is False
2020
21- assert bool (NotImplemented ) == True
22- assert bool (...) == True
21+ assert bool (NotImplemented ) is True
22+ assert bool (...) is True
2323
2424if not 1 :
2525 raise BaseException
@@ -105,8 +105,8 @@ def __len__(self):
105105 return 1
106106
107107
108- assert bool (TestMagicMethodLenZero ()) == False
109- assert bool (TestMagicMethodLenOne ()) == True
108+ assert bool (TestMagicMethodLenZero ()) is False
109+ assert bool (TestMagicMethodLenOne ()) is True
110110
111111
112112# check __len__ and __bool__
Original file line number Diff line number Diff line change 2323
2424# magic methods should only be implemented for other ints
2525
26- assert (1 ).__eq__ (1 ) == True
27- assert (1 ).__ne__ (1 ) == False
28- assert (1 ).__gt__ (1 ) == False
29- assert (1 ).__ge__ (1 ) == True
30- assert (1 ).__lt__ (1 ) == False
31- assert (1 ).__le__ (1 ) == True
26+ assert (1 ).__eq__ (1 ) is True
27+ assert (1 ).__ne__ (1 ) is False
28+ assert (1 ).__gt__ (1 ) is False
29+ assert (1 ).__ge__ (1 ) is True
30+ assert (1 ).__lt__ (1 ) is False
31+ assert (1 ).__le__ (1 ) is True
3232assert (1 ).__add__ (1 ) == 2
3333assert (1 ).__radd__ (1 ) == 2
3434assert (2 ).__sub__ (1 ) == 1
You can’t perform that action at this time.
0 commit comments