Skip to content

Commit

Permalink
add asyncio.__all__ (#13038)
Browse files Browse the repository at this point in the history
  • Loading branch information
tungol authored Dec 28, 2024
1 parent abed9a8 commit 8726734
Show file tree
Hide file tree
Showing 19 changed files with 1,320 additions and 0 deletions.
1,300 changes: 1,300 additions & 0 deletions stdlib/asyncio/__init__.pyi

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions stdlib/asyncio/base_events.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions stdlib/asyncio/coroutines.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions stdlib/asyncio/events.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions stdlib/asyncio/exceptions.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sys

# Keep asyncio.__all__ updated with any changes to __all__ here
if sys.version_info >= (3, 11):
__all__ = (
"BrokenBarrierError",
Expand Down
1 change: 1 addition & 0 deletions stdlib/asyncio/futures.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions stdlib/asyncio/locks.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions stdlib/asyncio/protocols.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions stdlib/asyncio/queues.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
1 change: 1 addition & 0 deletions stdlib/asyncio/runners.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions stdlib/asyncio/streams.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions stdlib/asyncio/subprocess.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions stdlib/asyncio/taskgroups.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions stdlib/asyncio/tasks.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions stdlib/asyncio/threads.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions stdlib/asyncio/timeouts.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions stdlib/asyncio/transports.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions stdlib/asyncio/unix_events.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -29,6 +31,7 @@ if sys.platform != "win32":
"EventLoop",
)
elif sys.version_info >= (3, 9):
# adds PidfdChildWatcher
__all__ = (
"SelectorEventLoop",
"AbstractChildWatcher",
Expand Down
1 change: 1 addition & 0 deletions stdlib/asyncio/windows_events.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down

0 comments on commit 8726734

Please sign in to comment.