Currently the builtins.pyi stub file has the following definition for `slice`:
```py
class slice(object):
start: Any
step: Any
stop: Any
@overload
def __init__(self, stop: Any) -> None: ...
@overload
def __init__(self, start: Any, stop: Any, step: Any = ...) -> None: ...
__hash__: None # type: ignore
def indices(self, len: int) -> Tuple[int, int, int]: ...
```
Would you want it to have a single type parameter, so start/stop/step should all have the same type, or do you think there's a need to specify their types separately?
The simplest improvement I could think of would use a single type parameter, be something like
```py
class slice(Generic[T]):
start: Optional[T]
step: Optional[T]
stop: Optional[T]
@overload
def __init__(self, stop: Optional[T]) -> None: ...
@overload
def __init__(self, start:
Optional[T]
, stop:
Optional[T]
, step:
Optional[T]
= ...) -> None: ...
__hash__: None # type: ignore
def indices(self, len: int) -> Tuple[int, int, int]: ...
```
Note that the `indices()` method is only useful if T is int.
I wouldn't be surprised if there were additional pitfalls though -- I don't have much experience myself with non-numeric indexes.