-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
Support Decorators Maintaining Signatures of Generic Functions #27404
Labels
Typing
type annotations, mypy/pyright type checking
Comments
Does |
Possibly related to #13875. |
@simonjayhawkins you recently had a solution for this right? Interested in extending it too pandas.util._decorators? |
1 task
Sounds good - thanks for taking a look |
Does being py37+ make this any more solvable? |
This should already be resolved here: Line 101 in 6f2c60e
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As a follow up to #27393 I think I made a mistake in just typing some of the return values to be
Callable
. The following script highlights that issue:If you run that from the project root you'll get something like the following:
We probably want to maintain the types of the signature for
func2
so I think need to use TypeVar for generic support.More info on the mypy side in:
python/mypy#3113
python/mypy#1551
So I think need something like:
The text was updated successfully, but these errors were encountered: