Improve stubs for sequence types (#6386)

This commit is contained in:
Alex Waygood
2021-11-27 03:09:38 +00:00
committed by GitHub
parent 6130c2459e
commit 98af7d667f
9 changed files with 32 additions and 29 deletions

View File

@@ -13,6 +13,7 @@ from typing import (
Union,
overload,
)
from typing_extensions import SupportsIndex
from google.protobuf.descriptor import Descriptor
from google.protobuf.internal.message_listener import MessageListener
@@ -33,7 +34,7 @@ class BaseContainer(Sequence[_T]):
def __repr__(self) -> str: ...
def sort(self, *, key: Optional[Callable[[_T], Any]] = ..., reverse: bool = ...) -> None: ...
@overload
def __getitem__(self, key: int) -> _T: ...
def __getitem__(self, key: SupportsIndex) -> _T: ...
@overload
def __getitem__(self, key: slice) -> List[_T]: ...