Skip to content

Add __name__ to _Wrapped in functools #9835

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

Merged
merged 4 commits into from
Mar 3, 2023
Merged

Conversation

tmke8
Copy link
Contributor

@tmke8 tmke8 commented Mar 3, 2023

There can be scenarios where __name__ isn't set, as pointed out here: python/mypy#14815 (comment) but the same is true for Callable, so this has precedent.

@github-actions

This comment has been minimized.

@tmke8
Copy link
Contributor Author

tmke8 commented Mar 3, 2023

Mypy primer looks as expected 🚀

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

LGTM. @erictraut, does this make sense to you?

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2023

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

pandas (https://github.com/pandas-dev/pandas)
- pandas/core/strings/accessor.py:130: error: "_Wrapped[<nothing>, <nothing>, [Any, VarArg(Any), KwArg(Any)], Any]" has no attribute "__name__"  [attr-defined]

spark (https://github.com/apache/spark)
- python/pyspark/sql/udf.py:428: error: "_Wrapped[[VarArg(Any), KwArg(Any)], Any, [VarArg(Union[Column, str])], Column]" has no attribute "__name__"  [attr-defined]
- python/pyspark/sql/connect/udf.py:159: error: "_Wrapped[[VarArg(Any), KwArg(Any)], Any, [VarArg(Union[Column, str])], Column]" has no attribute "__name__"  [attr-defined]

streamlit (https://github.com/streamlit/streamlit)
- lib/streamlit/deprecation_util.py: note: In function "deprecate_func_name":
- lib/streamlit/deprecation_util.py:81:5: error: "_Wrapped[<nothing>, <nothing>, [VarArg(Any), KwArg(Any)], Any]" has no attribute "__name__"  [attr-defined]

@erictraut
Copy link
Contributor

Yeah, makes sense to me.

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.

3 participants