@@ -12,7 +12,7 @@ from collections.abc import Callable, Sequence
1212from concurrent .futures import Executor
1313from contextvars import Context
1414from socket import AddressFamily , SocketKind , _Address , _RetAddress , socket
15- from typing import IO , Any , Literal , Protocol , TypeVar , overload
15+ from typing import IO , Any , Literal , Protocol , TypeVar , overload , type_check_only
1616from typing_extensions import Self , TypeAlias , TypeVarTuple , Unpack , deprecated
1717
1818from . import _AwaitableLike , _CoroutineLike
@@ -68,6 +68,7 @@ _ExceptionHandler: TypeAlias = Callable[[AbstractEventLoop, _Context], object]
6868_ProtocolFactory : TypeAlias = Callable [[], BaseProtocol ]
6969_SSLContext : TypeAlias = bool | None | ssl .SSLContext
7070
71+ @type_check_only
7172class _TaskFactory (Protocol ):
7273 def __call__ (self , loop : AbstractEventLoop , factory : _CoroutineLike [_T ], / ) -> Future [_T ]: ...
7374
@@ -599,6 +600,7 @@ class AbstractEventLoop:
599600 @abstractmethod
600601 async def shutdown_default_executor (self ) -> None : ...
601602
603+ @type_check_only
602604class _AbstractEventLoopPolicy :
603605 @abstractmethod
604606 def get_event_loop (self ) -> AbstractEventLoop : ...
0 commit comments