blob: 4817435b1e7ce40c0f6d624f5e49baa40f34f6b5 [file] [edit]
[case testDundersNotImplemented]
# This case is special because it tests the behavior of NotImplemented
# used in a typed function which return type is bool.
# This is a convention that can be overridden by the user.
class UsesNotImplemented:
def __eq__(self, b: object) -> bool:
return NotImplemented
def test_not_implemented() -> None:
assert UsesNotImplemented() != object()
x = UsesNotImplemented() == object()
assert not x