add asyncio.__all__ (#13038)

This commit is contained in:
Stephen Morton
2024-12-27 20:58:40 -08:00
committed by GitHub
parent abed9a8b55
commit 87267342d5
19 changed files with 1320 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -13,6 +13,7 @@ from socket import AddressFamily, SocketKind, _Address, _RetAddress, socket
from typing import IO, Any, Literal, TypeVar, overload
from typing_extensions import TypeAlias, TypeVarTuple, Unpack
# Keep asyncio.__all__ updated with any changes to __all__ here
if sys.version_info >= (3, 9):
__all__ = ("BaseEventLoop", "Server")
else:

View File

@@ -3,6 +3,7 @@ from collections.abc import Awaitable, Callable, Coroutine
from typing import Any, TypeVar, overload
from typing_extensions import ParamSpec, TypeGuard, TypeIs
# Keep asyncio.__all__ updated with any changes to __all__ here
if sys.version_info >= (3, 11):
__all__ = ("iscoroutinefunction", "iscoroutine")
else:

View File

@@ -22,6 +22,7 @@ from .tasks import Task
from .transports import BaseTransport, DatagramTransport, ReadTransport, SubprocessTransport, Transport, WriteTransport
from .unix_events import AbstractChildWatcher
# Keep asyncio.__all__ updated with any changes to __all__ here
if sys.version_info >= (3, 14):
__all__ = (
"AbstractEventLoopPolicy",

View File

@@ -1,5 +1,6 @@
import sys
# Keep asyncio.__all__ updated with any changes to __all__ here
if sys.version_info >= (3, 11):
__all__ = (
"BrokenBarrierError",

View File

@@ -5,6 +5,7 @@ from typing_extensions import TypeIs
from .events import AbstractEventLoop
# Keep asyncio.__all__ updated with any changes to __all__ here
__all__ = ("Future", "wrap_future", "isfuture")
_T = TypeVar("_T")

View File

@@ -15,6 +15,7 @@ if sys.version_info >= (3, 10):
else:
_LoopBoundMixin = object
# Keep asyncio.__all__ updated with any changes to __all__ here
if sys.version_info >= (3, 11):
__all__ = ("Lock", "Event", "Condition", "Semaphore", "BoundedSemaphore", "Barrier")
else:

View File

@@ -2,6 +2,7 @@ from _typeshed import ReadableBuffer
from asyncio import transports
from typing import Any
# Keep asyncio.__all__ updated with any changes to __all__ here
__all__ = ("BaseProtocol", "Protocol", "DatagramProtocol", "SubprocessProtocol", "BufferedProtocol")
class BaseProtocol:

View File

@@ -13,6 +13,7 @@ else:
class QueueEmpty(Exception): ...
class QueueFull(Exception): ...
# Keep asyncio.__all__ updated with any changes to __all__ here
if sys.version_info >= (3, 13):
__all__ = ("Queue", "PriorityQueue", "LifoQueue", "QueueFull", "QueueEmpty", "QueueShutDown")

View File

@@ -7,6 +7,7 @@ from typing_extensions import Self
from .events import AbstractEventLoop
# Keep asyncio.__all__ updated with any changes to __all__ here
if sys.version_info >= (3, 11):
__all__ = ("Runner", "run")
else:

View File

@@ -9,6 +9,7 @@ from typing_extensions import Self, TypeAlias
from . import events, protocols, transports
from .base_events import Server
# Keep asyncio.__all__ updated with any changes to __all__ here
if sys.platform == "win32":
__all__ = ("StreamReader", "StreamWriter", "StreamReaderProtocol", "open_connection", "start_server")
else:

View File

@@ -5,6 +5,7 @@ from asyncio import events, protocols, streams, transports
from collections.abc import Callable, Collection
from typing import IO, Any, Literal
# Keep asyncio.__all__ updated with any changes to __all__ here
__all__ = ("create_subprocess_exec", "create_subprocess_shell")
PIPE: int

View File

@@ -8,6 +8,7 @@ from . import _CoroutineLike
from .events import AbstractEventLoop
from .tasks import Task
# Keep asyncio.__all__ updated with any changes to __all__ here
if sys.version_info >= (3, 12):
__all__ = ("TaskGroup",)
else:

View File

@@ -18,6 +18,7 @@ from .futures import Future
if sys.version_info >= (3, 11):
from contextvars import Context
# Keep asyncio.__all__ updated with any changes to __all__ here
if sys.version_info >= (3, 12):
__all__ = (
"Task",

View File

@@ -2,6 +2,7 @@ from collections.abc import Callable
from typing import TypeVar
from typing_extensions import ParamSpec
# Keep asyncio.__all__ updated with any changes to __all__ here
__all__ = ("to_thread",)
_P = ParamSpec("_P")
_R = TypeVar("_R")

View File

@@ -2,6 +2,7 @@ from types import TracebackType
from typing import final
from typing_extensions import Self
# Keep asyncio.__all__ updated with any changes to __all__ here
__all__ = ("Timeout", "timeout", "timeout_at")
@final

View File

@@ -4,6 +4,7 @@ from collections.abc import Iterable, Mapping
from socket import _Address
from typing import Any
# Keep asyncio.__all__ updated with any changes to __all__ here
__all__ = ("BaseTransport", "ReadTransport", "WriteTransport", "Transport", "DatagramTransport", "SubprocessTransport")
class BaseTransport:

View File

@@ -13,10 +13,12 @@ from .selector_events import BaseSelectorEventLoop
_Ts = TypeVarTuple("_Ts")
# Keep asyncio.__all__ updated with any changes to __all__ here
if sys.platform != "win32":
if sys.version_info >= (3, 14):
__all__ = ("SelectorEventLoop", "DefaultEventLoopPolicy", "EventLoop")
elif sys.version_info >= (3, 13):
# Adds EventLoop
__all__ = (
"SelectorEventLoop",
"AbstractChildWatcher",
@@ -29,6 +31,7 @@ if sys.platform != "win32":
"EventLoop",
)
elif sys.version_info >= (3, 9):
# adds PidfdChildWatcher
__all__ = (
"SelectorEventLoop",
"AbstractChildWatcher",

View File

@@ -6,6 +6,7 @@ from typing import IO, Any, ClassVar, Final, NoReturn
from . import events, futures, proactor_events, selector_events, streams, windows_utils
# Keep asyncio.__all__ updated with any changes to __all__ here
if sys.platform == "win32":
if sys.version_info >= (3, 13):
# 3.13 added `EventLoop`.