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 item types are considered to be Any. A better approach would be to understand that a[0] is always an int while a[2] is invalid without some check (however we can't do isinstance() checks on tuple lengths so that's problematic).
The text was updated successfully, but these errors were encountered:
Fixes#4286Fixes#2509
The fix is straightforward, map the indexing through union types. I decided to use the existing error message mentioning the full type. IMO `Value of type "Union[int, List[int]]" is not indexable` is better than `Value of type "int" is not idexable`.
See python/typeshed#721 (comment). The issue is that after
the item types are considered to be Any. A better approach would be to understand that a[0] is always an int while a[2] is invalid without some check (however we can't do isinstance() checks on tuple lengths so that's problematic).
The text was updated successfully, but these errors were encountered: