Skip to content

Fix union callees with functools.partial#17903

Merged
hauntsaninja merged 2 commits into
masterfrom
partial-union
Oct 9, 2024
Merged

Fix union callees with functools.partial#17903
hauntsaninja merged 2 commits into
masterfrom
partial-union

Conversation

@JukkaL

@JukkaL JukkaL commented Oct 9, 2024

Copy link
Copy Markdown
Collaborator

Fixes #17741.

@JukkaL
JukkaL requested a review from hauntsaninja October 9, 2024 12:25
@github-actions

github-actions Bot commented Oct 9, 2024

Copy link
Copy Markdown
Contributor

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]

@hauntsaninja hauntsaninja left a comment

Copy link
Copy Markdown
Collaborator

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
@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