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
Fixes#2410
`slice` has been generic in typeshed for more than a year now. Also all
builtin collections have precise `slice[SupportsIndex | None]` types for
`__getitem__()`. So, I don't think we need to be "policing" `slice`
anymore, it should be really responsibility of the stub maintainers now.
After some searching, I see there are still many plain `slice`
annotations in the wild, so this will be a trade-off of false positives
to false negatives, but I think this is a right trade-off, since status
quo causes issues for pandas dataframes and similar APIs.
I also considered some "intermediate" solutions, where we would still
enforce `SupportsIndex` in _some_ situations, but can't find anything
that wouldn't be overly complicated.
0 commit comments