mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 00:37:10 +08:00
@@ -252,32 +252,31 @@ class AsyncIterator(AsyncIterable[_T_co], Protocol[_T_co]):
|
||||
def __anext__(self) -> Awaitable[_T_co]: ...
|
||||
def __aiter__(self) -> AsyncIterator[_T_co]: ...
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
class AsyncGenerator(AsyncIterator[_T_co], Generic[_T_co, _T_contra]):
|
||||
@abstractmethod
|
||||
def __anext__(self) -> Awaitable[_T_co]: ...
|
||||
@abstractmethod
|
||||
def asend(self, __value: _T_contra) -> Awaitable[_T_co]: ...
|
||||
@overload
|
||||
@abstractmethod
|
||||
def athrow(
|
||||
self, __typ: Type[BaseException], __val: Union[BaseException, object] = ..., __tb: Optional[TracebackType] = ...
|
||||
) -> Awaitable[_T_co]: ...
|
||||
@overload
|
||||
@abstractmethod
|
||||
def athrow(self, __typ: BaseException, __val: None = ..., __tb: Optional[TracebackType] = ...) -> Awaitable[_T_co]: ...
|
||||
@abstractmethod
|
||||
def aclose(self) -> Awaitable[None]: ...
|
||||
@abstractmethod
|
||||
def __aiter__(self) -> AsyncGenerator[_T_co, _T_contra]: ...
|
||||
@property
|
||||
def ag_await(self) -> Any: ...
|
||||
@property
|
||||
def ag_code(self) -> CodeType: ...
|
||||
@property
|
||||
def ag_frame(self) -> FrameType: ...
|
||||
@property
|
||||
def ag_running(self) -> bool: ...
|
||||
class AsyncGenerator(AsyncIterator[_T_co], Generic[_T_co, _T_contra]):
|
||||
@abstractmethod
|
||||
def __anext__(self) -> Awaitable[_T_co]: ...
|
||||
@abstractmethod
|
||||
def asend(self, __value: _T_contra) -> Awaitable[_T_co]: ...
|
||||
@overload
|
||||
@abstractmethod
|
||||
def athrow(
|
||||
self, __typ: Type[BaseException], __val: Union[BaseException, object] = ..., __tb: Optional[TracebackType] = ...
|
||||
) -> Awaitable[_T_co]: ...
|
||||
@overload
|
||||
@abstractmethod
|
||||
def athrow(self, __typ: BaseException, __val: None = ..., __tb: Optional[TracebackType] = ...) -> Awaitable[_T_co]: ...
|
||||
@abstractmethod
|
||||
def aclose(self) -> Awaitable[None]: ...
|
||||
@abstractmethod
|
||||
def __aiter__(self) -> AsyncGenerator[_T_co, _T_contra]: ...
|
||||
@property
|
||||
def ag_await(self) -> Any: ...
|
||||
@property
|
||||
def ag_code(self) -> CodeType: ...
|
||||
@property
|
||||
def ag_frame(self) -> FrameType: ...
|
||||
@property
|
||||
def ag_running(self) -> bool: ...
|
||||
|
||||
@runtime_checkable
|
||||
class Container(Protocol[_T_co]):
|
||||
@@ -286,19 +285,13 @@ class Container(Protocol[_T_co]):
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
@runtime_checkable
|
||||
class Collection(Iterable[_T_co], Container[_T_co], Protocol[_T_co]):
|
||||
# Implement Sized (but don't have it as a base class).
|
||||
@abstractmethod
|
||||
def __len__(self) -> int: ...
|
||||
_Collection = Collection[_T_co]
|
||||
else:
|
||||
@runtime_checkable
|
||||
class _Collection(Iterable[_T_co], Container[_T_co], Protocol[_T_co]):
|
||||
# Implement Sized (but don't have it as a base class).
|
||||
@abstractmethod
|
||||
def __len__(self) -> int: ...
|
||||
@runtime_checkable
|
||||
class Collection(Iterable[_T_co], Container[_T_co], Protocol[_T_co]):
|
||||
# Implement Sized (but don't have it as a base class).
|
||||
@abstractmethod
|
||||
def __len__(self) -> int: ...
|
||||
|
||||
_Collection = Collection[_T_co]
|
||||
|
||||
class Sequence(_Collection[_T_co], Reversible[_T_co], Generic[_T_co]):
|
||||
@overload
|
||||
@@ -573,8 +566,7 @@ class Match(Generic[AnyStr]):
|
||||
def span(self, __group: Union[int, str] = ...) -> Tuple[int, int]: ...
|
||||
@property
|
||||
def regs(self) -> Tuple[Tuple[int, int], ...]: ... # undocumented
|
||||
if sys.version_info >= (3, 6):
|
||||
def __getitem__(self, g: Union[int, str]) -> AnyStr: ...
|
||||
def __getitem__(self, g: Union[int, str]) -> AnyStr: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user