Skip to content

Added error code for overlapping function signatures - #17597

Merged
JelleZijlstra merged 15 commits into
python:masterfrom
katconnors:issue-17570-error-code
Sep 18, 2024
Merged

JelleZijlstra merged 15 commits into
python:masterfrom
katconnors:issue-17570-error-code

Conversation

@katconnors

Copy link
Copy Markdown
Contributor

Closes #17570. This is my first contribution to mypy! 🐍
Added an error code for overlapping function signatures.
Test in check-errorcodes.test is a derivative of this post: https://stackoverflow.com/q/69341607

@katconnors

Copy link
Copy Markdown
Contributor Author

mypy_primer (2) timed out- wonder if it had the same issue as here:
#17588 (comment)

@github-actions

This comment has been minimized.

Comment thread mypy/errorcodes.py Resolved
katconnors and others added 2 commits July 29, 2024 16:54
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@github-actions

This comment has been minimized.

Comment thread mypy/checker.py Resolved
Comment thread mypy/errorcodes.py Resolved
Comment thread docs/source/error_code_list.rst Resolved
@github-actions

This comment has been minimized.

@katconnors
katconnors requested a review from JelleZijlstra July 30, 2024 06:08
@katconnors

Copy link
Copy Markdown
Contributor Author

@JelleZijlstra made the requested changes, if you don't mind taking another look. Thanks in advance!

Comment thread mypy/message_registry.py Resolved
Comment thread mypy/errorcodes.py Resolved
Comment thread docs/source/error_code_list.rst Resolved
Comment thread docs/source/error_code_list.rst Resolved
@github-actions

This comment has been minimized.

@katconnors

Copy link
Copy Markdown
Contributor Author

Gentle reminder for review, @JelleZijlstra or @AlexWaygood. Thanks both!

Comment thread docs/source/error_code_list.rst Resolved
Comment thread docs/source/error_code_list.rst Resolved
Comment thread docs/source/error_code_list.rst Resolved
katconnors and others added 3 commits September 13, 2024 16:09
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

pydantic (https://github.com/pydantic/pydantic)
- pydantic/experimental/pipeline.py:209: error: Overloaded function signature 10 will never be matched: signature 8's parameter type(s) are the same or broader  [misc]
+ pydantic/experimental/pipeline.py:209: error: Overloaded function signature 10 will never be matched: signature 8's parameter type(s) are the same or broader  [overload-cannot-match]
- pydantic/experimental/pipeline.py:212: error: Overloaded function signature 11 will never be matched: signature 8's parameter type(s) are the same or broader  [misc]
+ pydantic/experimental/pipeline.py:212: error: Overloaded function signature 11 will never be matched: signature 8's parameter type(s) are the same or broader  [overload-cannot-match]
- pydantic/experimental/pipeline.py:215: error: Overloaded function signature 12 will never be matched: signature 8's parameter type(s) are the same or broader  [misc]
+ pydantic/experimental/pipeline.py:215: error: Overloaded function signature 12 will never be matched: signature 8's parameter type(s) are the same or broader  [overload-cannot-match]
- pydantic/experimental/pipeline.py:218: error: Overloaded function signature 13 will never be matched: signature 8's parameter type(s) are the same or broader  [misc]
+ pydantic/experimental/pipeline.py:218: error: Overloaded function signature 13 will never be matched: signature 8's parameter type(s) are the same or broader  [overload-cannot-match]

pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
+ pandas-stubs/io/excel/_base.pyi:123: error: Unused "type: ignore" comment, use narrower [overload-cannot-match] instead of [misc] code  [unused-ignore]

discord.py (https://github.com/Rapptz/discord.py)
- discord/guild.py:3061: error: Overloaded function signature 3 will never be matched: signature 1's parameter type(s) are the same or broader  [misc]
+ discord/guild.py:3061: error: Overloaded function signature 3 will never be matched: signature 1's parameter type(s) are the same or broader  [overload-cannot-match]
- discord/guild.py:3076: error: Overloaded function signature 4 will never be matched: signature 2's parameter type(s) are the same or broader  [misc]
+ discord/guild.py:3076: error: Overloaded function signature 4 will never be matched: signature 2's parameter type(s) are the same or broader  [overload-cannot-match]
- discord/ext/commands/core.py:1484: error: Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader  [misc]
+ discord/ext/commands/core.py:1484: error: Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader  [overload-cannot-match]
- discord/ext/commands/core.py:1544: error: Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader  [misc]
+ discord/ext/commands/core.py:1544: error: Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader  [overload-cannot-match]

pytest-robotframework (https://github.com/detachhead/pytest-robotframework)
- pytest_robotframework/__init__.py:338: error: Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader  [misc]
+ pytest_robotframework/__init__.py:338: error: Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader  [overload-cannot-match]
- pytest_robotframework/__init__.py:472: error: Overloaded function signature 5 will never be matched: signature 4's parameter type(s) are the same or broader  [misc]
+ pytest_robotframework/__init__.py:472: error: Overloaded function signature 5 will never be matched: signature 4's parameter type(s) are the same or broader  [overload-cannot-match]
- pytest_robotframework/__init__.py:476: error: Overloaded function signature 6 will never be matched: signature 4's parameter type(s) are the same or broader  [misc]
+ pytest_robotframework/__init__.py:476: error: Overloaded function signature 6 will never be matched: signature 4's parameter type(s) are the same or broader  [overload-cannot-match]
- pytest_robotframework/__init__.py:476: error: Overloaded function signature 6 will never be matched: signature 5's parameter type(s) are the same or broader  [misc]
+ pytest_robotframework/__init__.py:476: error: Overloaded function signature 6 will never be matched: signature 5's parameter type(s) are the same or broader  [overload-cannot-match]

pandera (https://github.com/pandera-dev/pandera)
+ pandera/schema_inference/pandas.py:25: error: Unused "type: ignore" comment, use narrower [overload-cannot-match] instead of [misc] code  [unused-ignore]

prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/utilities/asyncutils.py:323: error: Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader  [misc]
+ src/prefect/utilities/asyncutils.py:323: error: Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader  [overload-cannot-match]
- src/prefect/client/schemas/objects.py:196: error: Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader  [misc]
+ src/prefect/client/schemas/objects.py:196: error: Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader  [overload-cannot-match]

antidote (https://github.com/Finistere/antidote)
- src/antidote/lib/interface_ext/__init__.py:1303: error: Overloaded function signature 4 will never be matched: signature 3's parameter type(s) are the same or broader  [misc]
+ src/antidote/lib/interface_ext/__init__.py:1303: error: Overloaded function signature 4 will never be matched: signature 3's parameter type(s) are the same or broader  [overload-cannot-match]
- src/antidote/lib/interface_ext/__init__.py:1335: error: Overloaded function signature 4 will never be matched: signature 3's parameter type(s) are the same or broader  [misc]
+ src/antidote/lib/interface_ext/__init__.py:1335: error: Overloaded function signature 4 will never be matched: signature 3's parameter type(s) are the same or broader  [overload-cannot-match]
@katconnors

Copy link
Copy Markdown
Contributor Author

Looks like checks have passed, and this can be merged when someone has time.

@JelleZijlstra
JelleZijlstra merged commit 4554bd0 into python:master Sep 18, 2024
@katconnors
katconnors deleted the issue-17570-error-code branch September 18, 2024 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants