Handle edge case in overload subtyping - #22007
Merged
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
Member
Author
|
Oh, it looks like using |
Member
Author
|
The actual problem was a reckless |
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: aiohttp (https://github.com/aio-libs/aiohttp)
+ aiohttp/helpers.py:990: error: Unused "type: ignore" comment [unused-ignore]
+ aiohttp/web_response.py:500: error: Unused "type: ignore" comment [unused-ignore]
+ aiohttp/web_response.py:509: error: Unused "type: ignore" comment [unused-ignore]
+ aiohttp/web_request.py:327: error: Unused "type: ignore" comment [unused-ignore]
+ aiohttp/web_request.py:336: error: Unused "type: ignore" comment [unused-ignore]
+ aiohttp/web_app.py:147: error: Unused "type: ignore" comment [unused-ignore]
+ aiohttp/web_app.py:162: error: Unused "type: ignore" comment [unused-ignore]
scikit-learn (https://github.com/scikit-learn/scikit-learn)
+ sklearn/externals/array_api_extra/testing/_testing.py:389: error: Unused "type: ignore" comment [unused-ignore]
pywin32 (https://github.com/mhammond/pywin32)
+ win32/Lib/win32timezone.py:673: error: Unused "type: ignore" comment [unused-ignore]
+ win32/Lib/win32timezone.py:728: error: Unused "type: ignore" comment [unused-ignore]
+ win32/Lib/win32timezone.py:739: error: Unused "type: ignore" comment [unused-ignore]
static-frame (https://github.com/static-frame/static-frame)
+ static_frame/core/series.py:791: error: Unused "type: ignore" comment [unused-ignore]
+ static_frame/core/series.py:4075: error: Unused "type: ignore" comment [unused-ignore]
+ static_frame/core/bus.py:680: error: Unused "type: ignore" comment [unused-ignore]
|
hauntsaninja
approved these changes
Sep 20, 2026
hauntsaninja
left a comment
Collaborator
There was a problem hiding this comment.
Wow, old issue fix!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #495
Fixes #12379
The solution is straightforward: we already have an existing (decent) method to union similar callables, so I simply refactor the code so that it can be used in
subtypes.pyto handle the relevant edge case.cc @JukkaL @hauntsaninja