| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks!
Sorry, something went wrong.
| def func1(callback: Callable[P1, str]) -> Callable[P1, str]: | ||
| def inner( | ||
| *args: P1.typo, # E: Use "P1.args" for variadic "*" parameter \ | ||
| # E: Name "P1.typo" is not defined |
There was a problem hiding this comment.
How hard would it be to make this say something like "ParamSpec has no attribute 'typo'" instead?
Sorry, something went wrong.
There was a problem hiding this comment.
Quite hard :)
Right now checkmember is not involved at all, this is semanal-level check.
We can change the error message (special case it for ParamSpec), but I don't think this is a good idea.
Sorry, something went wrong.
|
Thanks for noticing it! |
Sorry, something went wrong.
|
This still fails for me in the following example in Mypy playground (https://mypy-play.net/?mypy=master&python=3.10&gist=2f63e549be8913d2878f366612bb7b00): from typing import ParamSpec, Callable, TypeVar
T = TypeVar("T")
P = ParamSpec("P")
def twice(
f: Callable[P, T],
**kwargs: P.kwargs,
) -> T:
return f(**kwargs)Is this not supposed to work? |
Sorry, something went wrong.
|
It works just fine on master, the problem is that mypy-play.net's master is just some really old hardcoded revision. See ymyzk/mypy-playground#162 / ymyzk/mypy-playground#158 |
Sorry, something went wrong.
Ok, I assumed it was automatically pulling the latest changes 😅️. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Refs #13468
CC @JelleZijlstra