How do I fix the mypy error Overloaded function signatures 1 and 2 overlap with incompatible return types?
Here are my methods:
@typing.overload
def _find_pets_by_tags(
self,
query_params: typing.Union[
QueryParametersDictInput,
QueryParametersDict
],
security_index: typing.Optional[int] = None,
server_index: typing.Optional[int] = None,
stream: bool = False,
timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None,
skip_deserialization: typing_extensions.Literal[False] = False
) -> response_200.ApiResponse: ...
@typing.overload
def _find_pets_by_tags(
self,
query_params: typing.Union[
QueryParametersDictInput,
QueryParametersDict
],
security_index: typing.Optional[int] = None,
server_index: typing.Optional[int] = None,
stream: bool = False,
timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None,
skip_deserialization: typing_extensions.Literal[True] = ...
) -> api_response.ApiResponseWithoutDeserialization: ...
def _find_pets_by_tags(
self,
query_params: typing.Union[
QueryParametersDictInput,
QueryParametersDict
],
security_index: typing.Optional[int] = None,
server_index: typing.Optional[int] = None,
stream: bool = False,
timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None,
skip_deserialization: bool = False
):
And mypy complains that:
Overloaded function signatures 1 and 2 overlap with incompatible return types [misc]
But
- how are these methods overlapping? They require two different literal bool inputs
- What makes the return types incompatible? The overload requires two different class instances are returned. Both of them inherit from an api_client.ApiResponse base class