Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jul 26, 2024
1 parent 66bca55 commit 85ea18b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/source/error_code_list.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,7 @@ Check error code of overload function signature match
def process(response1: int,response2: int) -> int: # E: Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader [overloaded-function-matching]
...
def process(response1,response2)-> Union[float,int]:
def process(response1,response2)-> Union[float,int]:
return response1 + response2
Notify about an annotation in an unchecked function [annotation-unchecked]
Expand Down
2 changes: 1 addition & 1 deletion mypy/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ def check_overlapping_overloads(self, defn: OverloadedFuncDef) -> None:
continue

if overload_can_never_match(sig1, sig2):

self.msg.overloaded_signature_will_never_match(i + 1, i + j + 2, item2.func)
elif not is_descriptor_get:
# Note: we force mypy to check overload signatures in strict-optional mode
Expand Down
2 changes: 1 addition & 1 deletion mypy/message_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,4 +366,4 @@ def with_additional_msg(self, info: str) -> ErrorMessage:
# Overloads
OVERLOADED_FUNCTION_SIGNATURE: Final = ErrorMessage(
"Overloaded function signature {} will never be matched", codes.OVERLOADED_FUNCTION_MATCHING
)
)
5 changes: 1 addition & 4 deletions test-data/unit/check-errorcodes.test
Original file line number Diff line number Diff line change
Expand Up @@ -1208,8 +1208,5 @@ def process(response1: float,response2: float) -> float:
def process(response1: int,response2: int) -> int: # E: Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader [overloaded-function-matching]
...

def process(response1,response2)-> Union[float,int]:
def process(response1,response2)-> Union[float,int]:
return response1 + response2



0 comments on commit 85ea18b

Please sign in to comment.