You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function d takes two functions, an original, and a wrapper. The wrapper function needs to take the original function and its parameters.
Mypy is failing to infer the paramspec for the case where the wrapper indicates poisitional parameters. Unfortunately I'm too ignorant of the specifics of ParamSpec to know if this is working correctly or not 😢, but I would think that P would get inferred as [int]
@ilevkivskyi Can you provide any insight for this case?
FYI: This did not show an error in mypy 1.5.1, it inferred P as [i: int].
Concentrating on the second example, since it's simpler -- I think this is a valid use of Concatenate (though it took me a little bit of time to get my head around it).
The second error doesn't seem to be reported if you use mypy master, but the first one is still there.
Fixes#16296
In my big refactoring I flipped the variance convention for the
`Parameters` type, but I did it inconsistently in one place. After
working some more with ParamSpecs, it now seems to me the original
convention is easier to remember. I also now explicitly put it in the
type docstring.
The function
d
takes two functions, an original, and a wrapper. The wrapper function needs to take the original function and its parameters.Mypy is failing to infer the paramspec for the case where the wrapper indicates poisitional parameters. Unfortunately I'm too ignorant of the specifics of
ParamSpec
to know if this is working correctly or not 😢, but I would think thatP
would get inferred as[int]
@ilevkivskyi Can you provide any insight for this case?
FYI: This did not show an error in mypy 1.5.1, it inferred
P
as[i: int]
.The text was updated successfully, but these errors were encountered: