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
@carljm String and tuple support has already been implemented in #13562. Do you have something else in mind that goes beyond what's covered in that PR?
Following #13562, #13579 and #13667, I think the only thing we don't support with regard to type inference of subscript expressions is where a class does not define __class_getitem__ but its metaclass defines __getitem__. But we don't really support anything regarding metaclasses yet.
Oh, it looks like we might not support slices for string-literal and tuple types yet? x[1:3] should be inferred as tuple[str, str] if x has type tuple[int, str, str, int]. y[1:3] should be inferred as Literal["aa"] if y has type Literal["baab"].
We could probably also add special handling for subscript expressions where BytesLiteral types are on the l.h.s. and IntLiteral or BooleanLiteral types are on the r.h.s.
Limited support for inferring subscript expressions, e.g when the value is a tuple, or string.
The text was updated successfully, but these errors were encountered: