mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
asyncio: fix task factory types (#11993)
This commit is contained in:
@@ -2,7 +2,7 @@ import ssl
|
||||
import sys
|
||||
from _typeshed import FileDescriptorLike, ReadableBuffer, StrPath, Unused, WriteableBuffer
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from collections.abc import Callable, Coroutine, Generator, Sequence
|
||||
from collections.abc import Callable, Sequence
|
||||
from contextvars import Context
|
||||
from socket import AddressFamily, SocketKind, _Address, _RetAddress, socket
|
||||
from typing import IO, Any, Literal, Protocol, TypeVar, overload
|
||||
@@ -43,7 +43,7 @@ _ProtocolFactory: TypeAlias = Callable[[], BaseProtocol]
|
||||
_SSLContext: TypeAlias = bool | None | ssl.SSLContext
|
||||
|
||||
class _TaskFactory(Protocol):
|
||||
def __call__(self, loop: AbstractEventLoop, factory: Coroutine[Any, Any, _T] | Generator[Any, None, _T], /) -> Future[_T]: ...
|
||||
def __call__(self, loop: AbstractEventLoop, factory: _CoroutineLike[_T], /) -> Future[_T]: ...
|
||||
|
||||
class Handle:
|
||||
_cancelled: bool
|
||||
|
||||
Reference in New Issue
Block a user