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
Starting with version 1.1.358, pyright is no longer able to determine the correct type of f(id), it is now tuple[Unknown, A@f]. I presume the regression was introduced by #7630 or #7634.
A few observations:
If you remove the @d decorator, it stops working on 1.1.357 either, although it doesn't change the type of the f function itself.
Wrapping A and B in list[] (or any other generic) in the f's signature prevents pyright from successfully re-scoping type variables; if you rewrite f as def f[A, B](c: Callable[[A], B]) -> tuple[A, B] it works.
I understand I'm in a gray area of the typing spec. Feel free to close this. 😔
The text was updated successfully, but these errors were encountered:
Prior to version 1.1.357 the following code was type checked as I expected.
The revealed type is
tuple[A@f, A@f]
.Starting with version 1.1.358, pyright is no longer able to determine the correct type of
f(id)
, it is nowtuple[Unknown, A@f]
. I presume the regression was introduced by #7630 or #7634.A few observations:
@d
decorator, it stops working on 1.1.357 either, although it doesn't change the type of thef
function itself.A
andB
inlist[]
(or any other generic) in thef
's signature prevents pyright from successfully re-scoping type variables; if you rewritef
asdef f[A, B](c: Callable[[A], B]) -> tuple[A, B]
it works.I understand I'm in a gray area of the typing spec. Feel free to close this. 😔
The text was updated successfully, but these errors were encountered: