Add SupportsIndex stub to typing_extensions (#4442)

This was added to typing_extensions in python/typing#724.
This commit is contained in:
Omar Sandoval
2020-09-15 12:14:00 -07:00
committed by GitHub
parent d4191de79f
commit 7409af9f79

View File

@@ -98,3 +98,8 @@ _AnnotatedAlias: Any = ... # undocumented
# TypeAlias is a (non-subscriptable) special form.
class TypeAlias: ...
@runtime_checkable
class SupportsIndex(Protocol, metaclass=abc.ABCMeta):
@abc.abstractmethod
def __index__(self) -> int: ...