diff options
Diffstat (limited to 'Lib/typing.py')
-rw-r--r-- | Lib/typing.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/typing.py b/Lib/typing.py index 530d4633fe..7aab1628a3 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -74,6 +74,7 @@ __all__ = [ 'SupportsBytes', 'SupportsComplex', 'SupportsFloat', + 'SupportsIndex', 'SupportsInt', 'SupportsRound', @@ -1304,6 +1305,14 @@ class SupportsBytes(_Protocol): pass +class SupportsIndex(_Protocol): + __slots__ = () + + @abstractmethod + def __index__(self) -> int: + pass + + class SupportsAbs(_Protocol[T_co]): __slots__ = () |