@@ -6854,7 +6854,9 @@ reveal_type(headers) # N: Revealed type is "Union[__main__.Headers, typing.Iter
68546854[builtins fixtures/isinstancelist.pyi]
68556855
68566856[case testReturnNotImplementedInBinaryMagicMethods]
6857+ # flags: --warn-return-any
68576858from typing import Union
6859+
68586860class A:
68596861 def __add__(self, other: object) -> int:
68606862 return NotImplemented
@@ -6868,18 +6870,20 @@ class A:
68686870 def __mul__(self, other: object) -> Union[int, NotImplementedType]:
68696871 x: Union[int, NotImplementedType]
68706872 return x
6871-
68726873[builtins fixtures/notimplemented.pyi]
68736874
68746875[case testReturnNotImplementedABCSubclassHookMethod]
6876+ # flags: --warn-return-any
68756877class A:
68766878 @classmethod
68776879 def __subclasshook__(cls, t: type[object], /) -> bool:
68786880 return NotImplemented
68796881[builtins fixtures/notimplemented.pyi]
68806882
68816883[case testReturnNotImplementedInNormalMethods]
6884+ # flags: --warn-return-any
68826885from typing import Union
6886+
68836887class A:
68846888 def f(self) -> bool: return NotImplemented # E: Incompatible return value type (got "_NotImplementedType", expected "bool")
68856889 def g(self) -> NotImplementedType: return True # E: Incompatible return value type (got "bool", expected "_NotImplementedType")
@@ -6889,7 +6893,7 @@ class A:
68896893[builtins fixtures/notimplemented.pyi]
68906894
68916895[case testNotImplementedReturnedFromBinaryMagicMethod]
6892- # flags: --warn-unreachable
6896+ # flags: --warn-return-any
68936897from typing import Union
68946898
68956899class A:
@@ -6940,5 +6944,4 @@ reveal_type(a <= 1) # N: Revealed type is "builtins.bool"
69406944reveal_type(a < 1) # N: Revealed type is "Any"
69416945reveal_type(a and int()) # N: Revealed type is "Union[__main__.A, builtins.int]"
69426946reveal_type(int() or a) # N: Revealed type is "Union[builtins.int, __main__.A]"
6943-
69446947[builtins fixtures/notimplemented.pyi]
0 commit comments