File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 1+ [case testDundersNotImplemented]
2+ # This case is special because it tests the behavior of NotImplemented
3+ # used in a typed function which return type is bool.
4+ # This is a convention that can be overriden by the user.
5+ class UsesNotImplemented:
6+ def __eq__(self, b: object) -> bool:
7+ return NotImplemented
8+
9+ assert UsesNotImplemented() != object()
Original file line number Diff line number Diff line change @@ -32,10 +32,6 @@ class BoxedThing:
3232class Subclass2(BoxedThing):
3333 pass
3434
35- class UsesNotImplemented:
36- def __eq__(self, b: object) -> bool:
37- return NotImplemented
38-
3935def index_into(x : Any, y : Any) -> Any:
4036 return x[y]
4137
@@ -81,8 +77,6 @@ assert is_truthy(Item('a'))
8177assert not is_truthy(Subclass1(''))
8278assert is_truthy(Subclass1('a'))
8379
84- assert UsesNotImplemented() != object()
85-
8680internal_index_into()
8781[out]
88827 7
Original file line number Diff line number Diff line change 6363 "run-bench.test" ,
6464 "run-mypy-sim.test" ,
6565 "run-dunders.test" ,
66+ "run-dunders-special.test" ,
6667 "run-singledispatch.test" ,
6768 "run-attrs.test" ,
6869 "run-python37.test" ,
You can’t perform that action at this time.
0 commit comments