-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
[1.7] Any in decorated function with TypeVar #16482
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
Comments
|
@ilevkivskyi I think you're mistaken. It's replacing my TypeVar with Any, and throwing away the type information for my function's return type. This is a regression in 1.7. Look specifically at the error output, the first error says I just realised I forgot to include the arguments, but this reproduces with |
I understand this is counterintuitive, but taking into account signature of |
Yep, OK, I just went through typeshed and realised it made sense, but not why it appeared to work in older versions. Seems like it should use ParamSpec or something... |
Ah, that was already tried. If anybody else wants to track the current state of lru_cache, it's in python/typeshed#6347 |
Yeah, it's unfortunately a pretty difficult problem to fix in typeshed. There have been many attempts. |
I would note that the discussion around this issue appears to be waiting for some input from the mypy side though: |
Bug Report
This looks different to me, but could maybe be the same as #16481.
https://github.com/aio-libs/aiohttp-admin/actions/runs/6845242250/job/18610174092?pr=810
To Reproduce
Also at aio-libs/aiohttp-admin#810
Or, without pydantic:
Expected Behavior
There shouldn't be
Any
in these functions.The text was updated successfully, but these errors were encountered: