Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix union callees with functools.partial #17903

Merged
merged 2 commits into from
Oct 9, 2024
Merged

Fix union callees with functools.partial #17903

merged 2 commits into from
Oct 9, 2024

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Oct 9, 2024

Fixes #17741.

Copy link
Contributor

github-actions bot commented Oct 9, 2024

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

setuptools (https://github.com/pypa/setuptools)
- setuptools/config/setupcfg.py:303: error: "Callable[[str, Any], None] | Any" not callable  [misc]

pip (https://github.com/pypa/pip)
- src/pip/_internal/utils/misc.py:132: error: "Callable[[FunctionType, Path, BaseException], Any] | Callable[[FunctionType, Path, tuple[type[BaseException], BaseException, TracebackType]], Any]" not callable  [misc]
+ src/pip/_internal/utils/misc.py:132: error: Unexpected keyword argument "onexc"  [call-arg]

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Simpler than the changes I thought about when I saw the issue. mypy_primer checks out too

@hauntsaninja hauntsaninja merged commit eca206d into master Oct 9, 2024
19 checks passed
@hauntsaninja hauntsaninja deleted the partial-union branch October 9, 2024 18:52
JukkaL added a commit that referenced this pull request Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Union between a callable and a type not respected by functools.partial
2 participants