basedpyright 1.13.1 → 1.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/dist/pyright-langserver.js +1 -1
  2. package/dist/pyright-langserver.js.map +1 -1
  3. package/dist/pyright.js +1 -1
  4. package/dist/pyright.js.map +1 -1
  5. package/dist/typeshed-fallback/commit.txt +1 -1
  6. package/dist/typeshed-fallback/stdlib/VERSIONS +3 -1
  7. package/dist/typeshed-fallback/stdlib/_ast.pyi +1 -1
  8. package/dist/typeshed-fallback/stdlib/_bisect.pyi +221 -221
  9. package/dist/typeshed-fallback/stdlib/_csv.pyi +213 -213
  10. package/dist/typeshed-fallback/stdlib/_curses.pyi +1 -2
  11. package/dist/typeshed-fallback/stdlib/_heapq.pyi +67 -67
  12. package/dist/typeshed-fallback/stdlib/_interpchannels.pyi +84 -0
  13. package/dist/typeshed-fallback/stdlib/_json.pyi +92 -92
  14. package/dist/typeshed-fallback/stdlib/_lsprof.pyi +92 -92
  15. package/dist/typeshed-fallback/stdlib/_random.pyi +30 -30
  16. package/dist/typeshed-fallback/stdlib/_tkinter.pyi +7 -0
  17. package/dist/typeshed-fallback/stdlib/_weakref.pyi +3 -2
  18. package/dist/typeshed-fallback/stdlib/argparse.pyi +6 -2
  19. package/dist/typeshed-fallback/stdlib/array.pyi +281 -281
  20. package/dist/typeshed-fallback/stdlib/asyncio/events.pyi +56 -37
  21. package/dist/typeshed-fallback/stdlib/asyncio/tasks.pyi +4 -1
  22. package/dist/typeshed-fallback/stdlib/asyncio/unix_events.pyi +156 -134
  23. package/dist/typeshed-fallback/stdlib/asyncio/windows_events.pyi +3 -2
  24. package/dist/typeshed-fallback/stdlib/audioop.pyi +95 -95
  25. package/dist/typeshed-fallback/stdlib/binascii.pyi +123 -123
  26. package/dist/typeshed-fallback/stdlib/cmath.pyi +112 -112
  27. package/dist/typeshed-fallback/stdlib/dataclasses.pyi +1 -1
  28. package/dist/typeshed-fallback/stdlib/logging/__init__.pyi +2 -5
  29. package/dist/typeshed-fallback/stdlib/math.pyi +424 -424
  30. package/dist/typeshed-fallback/stdlib/mmap.pyi +160 -154
  31. package/dist/typeshed-fallback/stdlib/multiprocessing/context.pyi +10 -6
  32. package/dist/typeshed-fallback/stdlib/multiprocessing/sharedctypes.pyi +33 -12
  33. package/dist/typeshed-fallback/stdlib/os/__init__.pyi +10 -10
  34. package/dist/typeshed-fallback/stdlib/posixpath.pyi +3 -13
  35. package/dist/typeshed-fallback/stdlib/spwd.pyi +9 -0
  36. package/dist/typeshed-fallback/stdlib/subprocess.pyi +8 -0
  37. package/dist/typeshed-fallback/stdlib/tarfile.pyi +23 -1
  38. package/dist/typeshed-fallback/stdlib/telnetlib.pyi +1 -0
  39. package/dist/typeshed-fallback/stdlib/typing.pyi +21 -2
  40. package/dist/typeshed-fallback/stdlib/weakref.pyi +4 -1
  41. package/dist/typeshed-fallback/stdlib/xml/sax/handler.pyi +1 -1
  42. package/dist/typeshed-fallback/stdlib/zlib.pyi +157 -157
  43. package/dist/typeshed-fallback/stubs/Flask-SocketIO/flask_socketio/__init__.pyi +4 -4
  44. package/dist/typeshed-fallback/stubs/aiofiles/METADATA.toml +1 -1
  45. package/dist/typeshed-fallback/stubs/aiofiles/aiofiles/base.pyi +6 -20
  46. package/dist/typeshed-fallback/stubs/aiofiles/aiofiles/os.pyi +2 -0
  47. package/dist/typeshed-fallback/stubs/aiofiles/aiofiles/ospath.pyi +5 -3
  48. package/dist/typeshed-fallback/stubs/aiofiles/aiofiles/tempfile/__init__.pyi +143 -79
  49. package/dist/typeshed-fallback/stubs/aiofiles/aiofiles/threadpool/__init__.pyi +5 -5
  50. package/dist/typeshed-fallback/stubs/assertpy/assertpy/extracting.pyi +7 -1
  51. package/dist/typeshed-fallback/stubs/docker/docker/_types.pyi +8 -0
  52. package/dist/typeshed-fallback/stubs/docker/docker/api/container.pyi +2 -2
  53. package/dist/typeshed-fallback/stubs/docker/docker/api/image.pyi +3 -2
  54. package/dist/typeshed-fallback/stubs/docker/docker/api/network.pyi +32 -15
  55. package/dist/typeshed-fallback/stubs/docker/docker/models/containers.pyi +36 -7
  56. package/dist/typeshed-fallback/stubs/docker/docker/models/images.pyi +67 -5
  57. package/dist/typeshed-fallback/stubs/docker/docker/models/networks.pyi +20 -3
  58. package/dist/typeshed-fallback/stubs/docker/docker/types/containers.pyi +78 -70
  59. package/dist/typeshed-fallback/stubs/docker/docker/utils/json_stream.pyi +4 -7
  60. package/dist/typeshed-fallback/stubs/flake8/METADATA.toml +1 -1
  61. package/dist/typeshed-fallback/stubs/fpdf2/fpdf/fpdf.pyi +16 -5
  62. package/dist/typeshed-fallback/stubs/fpdf2/fpdf/image_datastructures.pyi +2 -1
  63. package/dist/typeshed-fallback/stubs/fpdf2/fpdf/table.pyi +4 -2
  64. package/dist/typeshed-fallback/stubs/fpdf2/fpdf/text_region.pyi +7 -7
  65. package/dist/typeshed-fallback/stubs/hdbcli/METADATA.toml +1 -1
  66. package/dist/typeshed-fallback/stubs/hdbcli/hdbcli/dbapi.pyi +1 -0
  67. package/dist/typeshed-fallback/stubs/hvac/METADATA.toml +1 -1
  68. package/dist/typeshed-fallback/stubs/hvac/hvac/api/system_backend/raft.pyi +9 -0
  69. package/dist/typeshed-fallback/stubs/hvac/hvac/api/system_backend/wrapping.pyi +1 -0
  70. package/dist/typeshed-fallback/stubs/influxdb-client/METADATA.toml +1 -1
  71. package/dist/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/_pages.pyi +37 -0
  72. package/dist/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/bucket_api.pyi +5 -1
  73. package/dist/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/tasks_api.pyi +4 -3
  74. package/dist/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/bucket.pyi +6 -6
  75. package/dist/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/task.pyi +6 -6
  76. package/dist/typeshed-fallback/stubs/networkx/METADATA.toml +3 -1
  77. package/dist/typeshed-fallback/stubs/olefile/olefile/olefile.pyi +41 -31
  78. package/dist/typeshed-fallback/stubs/openpyxl/METADATA.toml +1 -1
  79. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/cell/rich_text.pyi +3 -0
  80. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/chart/trendline.pyi +1 -2
  81. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/base.pyi +1 -1
  82. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/container.pyi +18 -0
  83. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/sequence.pyi +20 -12
  84. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/custom.pyi +1 -1
  85. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/extended.pyi +2 -2
  86. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/relationship.pyi +6 -11
  87. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/cache.pyi +66 -135
  88. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/fields.pyi +2 -2
  89. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/styles/alignment.pyi +0 -1
  90. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/styles/borders.pyi +0 -2
  91. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/styles/fills.pyi +3 -3
  92. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/styles/named_styles.pyi +5 -10
  93. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/utils/cell.pyi +2 -2
  94. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/utils/indexed_list.pyi +2 -2
  95. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/defined_name.pyi +2 -2
  96. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_read_only.pyi +11 -3
  97. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/datavalidation.pyi +2 -2
  98. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/dimensions.pyi +6 -3
  99. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/filters.pyi +26 -22
  100. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/hyperlink.pyi +3 -5
  101. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/views.pyi +5 -2
  102. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/worksheet.pyi +4 -2
  103. package/dist/typeshed-fallback/stubs/peewee/METADATA.toml +1 -1
  104. package/dist/typeshed-fallback/stubs/peewee/peewee.pyi +6 -1
  105. package/dist/typeshed-fallback/stubs/protobuf/METADATA.toml +2 -2
  106. package/dist/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor_pb2.pyi +84 -15
  107. package/dist/typeshed-fallback/stubs/psutil/METADATA.toml +1 -1
  108. package/dist/typeshed-fallback/stubs/psutil/psutil/__init__.pyi +3 -1
  109. package/dist/typeshed-fallback/stubs/psutil/psutil/_common.pyi +0 -2
  110. package/dist/typeshed-fallback/stubs/psutil/psutil/_compat.pyi +0 -1
  111. package/dist/typeshed-fallback/stubs/psutil/psutil/_psaix.pyi +1 -1
  112. package/dist/typeshed-fallback/stubs/psutil/psutil/_psbsd.pyi +1 -1
  113. package/dist/typeshed-fallback/stubs/psutil/psutil/_pslinux.pyi +2 -2
  114. package/dist/typeshed-fallback/stubs/psutil/psutil/_psosx.pyi +1 -1
  115. package/dist/typeshed-fallback/stubs/psutil/psutil/_pssunos.pyi +1 -1
  116. package/dist/typeshed-fallback/stubs/psutil/psutil/_psutil_osx.pyi +1 -1
  117. package/dist/typeshed-fallback/stubs/psutil/psutil/_pswindows.pyi +1 -1
  118. package/dist/typeshed-fallback/stubs/pyinstaller/METADATA.toml +1 -1
  119. package/dist/typeshed-fallback/stubs/pyinstaller/PyInstaller/__main__.pyi +1 -0
  120. package/dist/typeshed-fallback/stubs/pyinstaller/PyInstaller/building/splash.pyi +0 -2
  121. package/dist/typeshed-fallback/stubs/pyinstaller/PyInstaller/compat.pyi +2 -3
  122. package/dist/typeshed-fallback/stubs/reportlab/METADATA.toml +3 -2
  123. package/dist/typeshed-fallback/stubs/requests/requests/models.pyi +2 -2
  124. package/dist/typeshed-fallback/stubs/seaborn/METADATA.toml +2 -1
  125. package/dist/typeshed-fallback/stubs/setuptools/METADATA.toml +1 -1
  126. package/dist/typeshed-fallback/stubs/setuptools/pkg_resources/__init__.pyi +80 -50
  127. package/dist/typeshed-fallback/stubs/setuptools/setuptools/__init__.pyi +2 -4
  128. package/dist/typeshed-fallback/stubs/setuptools/setuptools/build_meta.pyi +6 -3
  129. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/bdist_egg.pyi +3 -9
  130. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/bdist_wheel.pyi +61 -0
  131. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/build_ext.pyi +2 -2
  132. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/build_py.pyi +12 -1
  133. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/easy_install.pyi +1 -1
  134. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/egg_info.pyi +4 -4
  135. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/install_lib.pyi +3 -4
  136. package/dist/typeshed-fallback/stubs/setuptools/setuptools/compat/py311.pyi +1 -1
  137. package/dist/typeshed-fallback/stubs/setuptools/setuptools/config/expand.pyi +0 -1
  138. package/dist/typeshed-fallback/stubs/shapely/METADATA.toml +2 -1
  139. package/dist/typeshed-fallback/stubs/shapely/shapely/_geometry.pyi +3 -3
  140. package/dist/typeshed-fallback/stubs/shapely/shapely/constructive.pyi +6 -6
  141. package/dist/typeshed-fallback/stubs/shapely/shapely/geometry/base.pyi +3 -3
  142. package/dist/typeshed-fallback/stubs/shapely/shapely/io.pyi +2 -2
  143. package/dist/typeshed-fallback/stubs/shapely/shapely/strtree.pyi +9 -9
  144. package/dist/typeshed-fallback/stubs/tree-sitter-languages/METADATA.toml +1 -1
  145. package/package.json +1 -1
  146. package/dist/typeshed-fallback/stubs/tree-sitter/METADATA.toml +0 -7
  147. package/dist/typeshed-fallback/stubs/tree-sitter/tree_sitter/__init__.pyi +0 -17
  148. package/dist/typeshed-fallback/stubs/tree-sitter/tree_sitter/binding.pyi +0 -115
@@ -16,23 +16,40 @@ from .tasks import Task
16
16
  from .transports import BaseTransport, DatagramTransport, ReadTransport, SubprocessTransport, Transport, WriteTransport
17
17
  from .unix_events import AbstractChildWatcher
18
18
 
19
- __all__ = (
20
- "AbstractEventLoopPolicy",
21
- "AbstractEventLoop",
22
- "AbstractServer",
23
- "Handle",
24
- "TimerHandle",
25
- "get_event_loop_policy",
26
- "set_event_loop_policy",
27
- "get_event_loop",
28
- "set_event_loop",
29
- "new_event_loop",
30
- "get_child_watcher",
31
- "set_child_watcher",
32
- "_set_running_loop",
33
- "get_running_loop",
34
- "_get_running_loop",
35
- )
19
+ if sys.version_info >= (3, 14):
20
+ __all__ = (
21
+ "AbstractEventLoopPolicy",
22
+ "AbstractEventLoop",
23
+ "AbstractServer",
24
+ "Handle",
25
+ "TimerHandle",
26
+ "get_event_loop_policy",
27
+ "set_event_loop_policy",
28
+ "get_event_loop",
29
+ "set_event_loop",
30
+ "new_event_loop",
31
+ "_set_running_loop",
32
+ "get_running_loop",
33
+ "_get_running_loop",
34
+ )
35
+ else:
36
+ __all__ = (
37
+ "AbstractEventLoopPolicy",
38
+ "AbstractEventLoop",
39
+ "AbstractServer",
40
+ "Handle",
41
+ "TimerHandle",
42
+ "get_event_loop_policy",
43
+ "set_event_loop_policy",
44
+ "get_event_loop",
45
+ "set_event_loop",
46
+ "new_event_loop",
47
+ "get_child_watcher",
48
+ "set_child_watcher",
49
+ "_set_running_loop",
50
+ "get_running_loop",
51
+ "_get_running_loop",
52
+ )
36
53
 
37
54
  _T = TypeVar("_T")
38
55
  _Ts = TypeVarTuple("_Ts")
@@ -541,18 +558,19 @@ class AbstractEventLoopPolicy:
541
558
  @abstractmethod
542
559
  def new_event_loop(self) -> AbstractEventLoop: ...
543
560
  # Child processes handling (Unix only).
544
- if sys.version_info >= (3, 12):
545
- @abstractmethod
546
- @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
547
- def get_child_watcher(self) -> AbstractChildWatcher: ...
548
- @abstractmethod
549
- @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
550
- def set_child_watcher(self, watcher: AbstractChildWatcher) -> None: ...
551
- else:
552
- @abstractmethod
553
- def get_child_watcher(self) -> AbstractChildWatcher: ...
554
- @abstractmethod
555
- def set_child_watcher(self, watcher: AbstractChildWatcher) -> None: ...
561
+ if sys.version_info < (3, 14):
562
+ if sys.version_info >= (3, 12):
563
+ @abstractmethod
564
+ @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
565
+ def get_child_watcher(self) -> AbstractChildWatcher: ...
566
+ @abstractmethod
567
+ @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
568
+ def set_child_watcher(self, watcher: AbstractChildWatcher) -> None: ...
569
+ else:
570
+ @abstractmethod
571
+ def get_child_watcher(self) -> AbstractChildWatcher: ...
572
+ @abstractmethod
573
+ def set_child_watcher(self, watcher: AbstractChildWatcher) -> None: ...
556
574
 
557
575
  class BaseDefaultEventLoopPolicy(AbstractEventLoopPolicy, metaclass=ABCMeta):
558
576
  def get_event_loop(self) -> AbstractEventLoop: ...
@@ -565,15 +583,16 @@ def get_event_loop() -> AbstractEventLoop: ...
565
583
  def set_event_loop(loop: AbstractEventLoop | None) -> None: ...
566
584
  def new_event_loop() -> AbstractEventLoop: ...
567
585
 
568
- if sys.version_info >= (3, 12):
569
- @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
570
- def get_child_watcher() -> AbstractChildWatcher: ...
571
- @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
572
- def set_child_watcher(watcher: AbstractChildWatcher) -> None: ...
586
+ if sys.version_info < (3, 14):
587
+ if sys.version_info >= (3, 12):
588
+ @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
589
+ def get_child_watcher() -> AbstractChildWatcher: ...
590
+ @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
591
+ def set_child_watcher(watcher: AbstractChildWatcher) -> None: ...
573
592
 
574
- else:
575
- def get_child_watcher() -> AbstractChildWatcher: ...
576
- def set_child_watcher(watcher: AbstractChildWatcher) -> None: ...
593
+ else:
594
+ def get_child_watcher() -> AbstractChildWatcher: ...
595
+ def set_child_watcher(watcher: AbstractChildWatcher) -> None: ...
577
596
 
578
597
  def _set_running_loop(loop: AbstractEventLoop | None, /) -> None: ...
579
598
  def _get_running_loop() -> AbstractEventLoop: ...
@@ -70,7 +70,10 @@ _T4 = TypeVar("_T4")
70
70
  _T5 = TypeVar("_T5")
71
71
  _T6 = TypeVar("_T6")
72
72
  _FT = TypeVar("_FT", bound=Future[Any])
73
- _FutureLike: TypeAlias = Future[_T] | Generator[Any, None, _T] | Awaitable[_T]
73
+ if sys.version_info >= (3, 12):
74
+ _FutureLike: TypeAlias = Future[_T] | Awaitable[_T]
75
+ else:
76
+ _FutureLike: TypeAlias = Future[_T] | Generator[Any, None, _T] | Awaitable[_T]
74
77
  _TaskYieldType: TypeAlias = Future[object] | None
75
78
 
76
79
  FIRST_COMPLETED = concurrent.futures.FIRST_COMPLETED
@@ -13,51 +13,54 @@ _Ts = TypeVarTuple("_Ts")
13
13
  # This is also technically not available on Win,
14
14
  # but other parts of typeshed need this definition.
15
15
  # So, it is special cased.
16
- if sys.version_info >= (3, 12):
17
- @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
18
- class AbstractChildWatcher:
19
- @abstractmethod
20
- def add_child_handler(
21
- self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
22
- ) -> None: ...
23
- @abstractmethod
24
- def remove_child_handler(self, pid: int) -> bool: ...
25
- @abstractmethod
26
- def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
27
- @abstractmethod
28
- def close(self) -> None: ...
29
- @abstractmethod
30
- def __enter__(self) -> Self: ...
31
- @abstractmethod
32
- def __exit__(
33
- self, typ: type[BaseException] | None, exc: BaseException | None, tb: types.TracebackType | None
34
- ) -> None: ...
35
- @abstractmethod
36
- def is_active(self) -> bool: ...
37
-
38
- else:
39
- class AbstractChildWatcher:
40
- @abstractmethod
41
- def add_child_handler(
42
- self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
43
- ) -> None: ...
44
- @abstractmethod
45
- def remove_child_handler(self, pid: int) -> bool: ...
46
- @abstractmethod
47
- def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
48
- @abstractmethod
49
- def close(self) -> None: ...
50
- @abstractmethod
51
- def __enter__(self) -> Self: ...
52
- @abstractmethod
53
- def __exit__(
54
- self, typ: type[BaseException] | None, exc: BaseException | None, tb: types.TracebackType | None
55
- ) -> None: ...
56
- @abstractmethod
57
- def is_active(self) -> bool: ...
16
+ if sys.version_info < (3, 14):
17
+ if sys.version_info >= (3, 12):
18
+ @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
19
+ class AbstractChildWatcher:
20
+ @abstractmethod
21
+ def add_child_handler(
22
+ self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
23
+ ) -> None: ...
24
+ @abstractmethod
25
+ def remove_child_handler(self, pid: int) -> bool: ...
26
+ @abstractmethod
27
+ def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
28
+ @abstractmethod
29
+ def close(self) -> None: ...
30
+ @abstractmethod
31
+ def __enter__(self) -> Self: ...
32
+ @abstractmethod
33
+ def __exit__(
34
+ self, typ: type[BaseException] | None, exc: BaseException | None, tb: types.TracebackType | None
35
+ ) -> None: ...
36
+ @abstractmethod
37
+ def is_active(self) -> bool: ...
38
+
39
+ else:
40
+ class AbstractChildWatcher:
41
+ @abstractmethod
42
+ def add_child_handler(
43
+ self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
44
+ ) -> None: ...
45
+ @abstractmethod
46
+ def remove_child_handler(self, pid: int) -> bool: ...
47
+ @abstractmethod
48
+ def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
49
+ @abstractmethod
50
+ def close(self) -> None: ...
51
+ @abstractmethod
52
+ def __enter__(self) -> Self: ...
53
+ @abstractmethod
54
+ def __exit__(
55
+ self, typ: type[BaseException] | None, exc: BaseException | None, tb: types.TracebackType | None
56
+ ) -> None: ...
57
+ @abstractmethod
58
+ def is_active(self) -> bool: ...
58
59
 
59
60
  if sys.platform != "win32":
60
- if sys.version_info >= (3, 9):
61
+ if sys.version_info >= (3, 14):
62
+ __all__ = ("SelectorEventLoop", "DefaultEventLoopPolicy")
63
+ elif sys.version_info >= (3, 9):
61
64
  __all__ = (
62
65
  "SelectorEventLoop",
63
66
  "AbstractChildWatcher",
@@ -79,118 +82,137 @@ if sys.platform != "win32":
79
82
  "DefaultEventLoopPolicy",
80
83
  )
81
84
 
82
- # Doesn't actually have ABCMeta metaclass at runtime, but mypy complains if we don't have it in the stub.
83
- # See discussion in #7412
84
- class BaseChildWatcher(AbstractChildWatcher, metaclass=ABCMeta):
85
- def close(self) -> None: ...
86
- def is_active(self) -> bool: ...
87
- def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
88
-
89
- if sys.version_info >= (3, 12):
90
- @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
91
- class SafeChildWatcher(BaseChildWatcher):
92
- def __enter__(self) -> Self: ...
93
- def __exit__(self, a: type[BaseException] | None, b: BaseException | None, c: types.TracebackType | None) -> None: ...
94
- def add_child_handler(
95
- self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
96
- ) -> None: ...
97
- def remove_child_handler(self, pid: int) -> bool: ...
85
+ if sys.version_info < (3, 14):
86
+ if sys.version_info >= (3, 12):
87
+ # Doesn't actually have ABCMeta metaclass at runtime, but mypy complains if we don't have it in the stub.
88
+ # See discussion in #7412
89
+ class BaseChildWatcher(AbstractChildWatcher, metaclass=ABCMeta):
90
+ def close(self) -> None: ...
91
+ def is_active(self) -> bool: ...
92
+ def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
98
93
 
99
- @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
100
- class FastChildWatcher(BaseChildWatcher):
101
- def __enter__(self) -> Self: ...
102
- def __exit__(self, a: type[BaseException] | None, b: BaseException | None, c: types.TracebackType | None) -> None: ...
103
- def add_child_handler(
104
- self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
105
- ) -> None: ...
106
- def remove_child_handler(self, pid: int) -> bool: ...
94
+ @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
95
+ class SafeChildWatcher(BaseChildWatcher):
96
+ def __enter__(self) -> Self: ...
97
+ def __exit__(
98
+ self, a: type[BaseException] | None, b: BaseException | None, c: types.TracebackType | None
99
+ ) -> None: ...
100
+ def add_child_handler(
101
+ self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
102
+ ) -> None: ...
103
+ def remove_child_handler(self, pid: int) -> bool: ...
107
104
 
108
- else:
109
- class SafeChildWatcher(BaseChildWatcher):
110
- def __enter__(self) -> Self: ...
111
- def __exit__(self, a: type[BaseException] | None, b: BaseException | None, c: types.TracebackType | None) -> None: ...
112
- def add_child_handler(
113
- self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
114
- ) -> None: ...
115
- def remove_child_handler(self, pid: int) -> bool: ...
105
+ @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
106
+ class FastChildWatcher(BaseChildWatcher):
107
+ def __enter__(self) -> Self: ...
108
+ def __exit__(
109
+ self, a: type[BaseException] | None, b: BaseException | None, c: types.TracebackType | None
110
+ ) -> None: ...
111
+ def add_child_handler(
112
+ self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
113
+ ) -> None: ...
114
+ def remove_child_handler(self, pid: int) -> bool: ...
116
115
 
117
- class FastChildWatcher(BaseChildWatcher):
118
- def __enter__(self) -> Self: ...
119
- def __exit__(self, a: type[BaseException] | None, b: BaseException | None, c: types.TracebackType | None) -> None: ...
120
- def add_child_handler(
121
- self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
122
- ) -> None: ...
123
- def remove_child_handler(self, pid: int) -> bool: ...
116
+ else:
117
+ # Doesn't actually have ABCMeta metaclass at runtime, but mypy complains if we don't have it in the stub.
118
+ # See discussion in #7412
119
+ class BaseChildWatcher(AbstractChildWatcher, metaclass=ABCMeta):
120
+ def close(self) -> None: ...
121
+ def is_active(self) -> bool: ...
122
+ def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
123
+
124
+ class SafeChildWatcher(BaseChildWatcher):
125
+ def __enter__(self) -> Self: ...
126
+ def __exit__(
127
+ self, a: type[BaseException] | None, b: BaseException | None, c: types.TracebackType | None
128
+ ) -> None: ...
129
+ def add_child_handler(
130
+ self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
131
+ ) -> None: ...
132
+ def remove_child_handler(self, pid: int) -> bool: ...
133
+
134
+ class FastChildWatcher(BaseChildWatcher):
135
+ def __enter__(self) -> Self: ...
136
+ def __exit__(
137
+ self, a: type[BaseException] | None, b: BaseException | None, c: types.TracebackType | None
138
+ ) -> None: ...
139
+ def add_child_handler(
140
+ self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
141
+ ) -> None: ...
142
+ def remove_child_handler(self, pid: int) -> bool: ...
124
143
 
125
144
  class _UnixSelectorEventLoop(BaseSelectorEventLoop): ...
126
145
 
127
146
  class _UnixDefaultEventLoopPolicy(BaseDefaultEventLoopPolicy):
128
- if sys.version_info >= (3, 12):
129
- @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
130
- def get_child_watcher(self) -> AbstractChildWatcher: ...
131
- @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
132
- def set_child_watcher(self, watcher: AbstractChildWatcher | None) -> None: ...
133
- else:
134
- def get_child_watcher(self) -> AbstractChildWatcher: ...
135
- def set_child_watcher(self, watcher: AbstractChildWatcher | None) -> None: ...
147
+ if sys.version_info < (3, 14):
148
+ if sys.version_info >= (3, 12):
149
+ @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
150
+ def get_child_watcher(self) -> AbstractChildWatcher: ...
151
+ @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
152
+ def set_child_watcher(self, watcher: AbstractChildWatcher | None) -> None: ...
153
+ else:
154
+ def get_child_watcher(self) -> AbstractChildWatcher: ...
155
+ def set_child_watcher(self, watcher: AbstractChildWatcher | None) -> None: ...
136
156
 
137
157
  SelectorEventLoop = _UnixSelectorEventLoop
138
158
 
139
159
  DefaultEventLoopPolicy = _UnixDefaultEventLoopPolicy
140
160
 
141
- if sys.version_info >= (3, 12):
142
- @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
143
- class MultiLoopChildWatcher(AbstractChildWatcher):
144
- def is_active(self) -> bool: ...
145
- def close(self) -> None: ...
146
- def __enter__(self) -> Self: ...
147
- def __exit__(
148
- self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None
149
- ) -> None: ...
150
- def add_child_handler(
151
- self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
152
- ) -> None: ...
153
- def remove_child_handler(self, pid: int) -> bool: ...
154
- def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
161
+ if sys.version_info < (3, 14):
162
+ if sys.version_info >= (3, 12):
163
+ @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
164
+ class MultiLoopChildWatcher(AbstractChildWatcher):
165
+ def is_active(self) -> bool: ...
166
+ def close(self) -> None: ...
167
+ def __enter__(self) -> Self: ...
168
+ def __exit__(
169
+ self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None
170
+ ) -> None: ...
171
+ def add_child_handler(
172
+ self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
173
+ ) -> None: ...
174
+ def remove_child_handler(self, pid: int) -> bool: ...
175
+ def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
155
176
 
156
- else:
157
- class MultiLoopChildWatcher(AbstractChildWatcher):
158
- def is_active(self) -> bool: ...
177
+ else:
178
+ class MultiLoopChildWatcher(AbstractChildWatcher):
179
+ def is_active(self) -> bool: ...
180
+ def close(self) -> None: ...
181
+ def __enter__(self) -> Self: ...
182
+ def __exit__(
183
+ self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None
184
+ ) -> None: ...
185
+ def add_child_handler(
186
+ self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
187
+ ) -> None: ...
188
+ def remove_child_handler(self, pid: int) -> bool: ...
189
+ def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
190
+
191
+ if sys.version_info < (3, 14):
192
+ class ThreadedChildWatcher(AbstractChildWatcher):
193
+ def is_active(self) -> Literal[True]: ...
159
194
  def close(self) -> None: ...
160
195
  def __enter__(self) -> Self: ...
161
196
  def __exit__(
162
197
  self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None
163
198
  ) -> None: ...
199
+ def __del__(self) -> None: ...
164
200
  def add_child_handler(
165
201
  self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
166
202
  ) -> None: ...
167
203
  def remove_child_handler(self, pid: int) -> bool: ...
168
204
  def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
169
205
 
170
- class ThreadedChildWatcher(AbstractChildWatcher):
171
- def is_active(self) -> Literal[True]: ...
172
- def close(self) -> None: ...
173
- def __enter__(self) -> Self: ...
174
- def __exit__(
175
- self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None
176
- ) -> None: ...
177
- def __del__(self) -> None: ...
178
- def add_child_handler(
179
- self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
180
- ) -> None: ...
181
- def remove_child_handler(self, pid: int) -> bool: ...
182
- def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
183
-
184
- if sys.version_info >= (3, 9):
185
- class PidfdChildWatcher(AbstractChildWatcher):
186
- def __enter__(self) -> Self: ...
187
- def __exit__(
188
- self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None
189
- ) -> None: ...
190
- def is_active(self) -> bool: ...
191
- def close(self) -> None: ...
192
- def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
193
- def add_child_handler(
194
- self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
195
- ) -> None: ...
196
- def remove_child_handler(self, pid: int) -> bool: ...
206
+ if sys.version_info >= (3, 9):
207
+ class PidfdChildWatcher(AbstractChildWatcher):
208
+ def __enter__(self) -> Self: ...
209
+ def __exit__(
210
+ self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None
211
+ ) -> None: ...
212
+ def is_active(self) -> bool: ...
213
+ def close(self) -> None: ...
214
+ def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
215
+ def add_child_handler(
216
+ self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
217
+ ) -> None: ...
218
+ def remove_child_handler(self, pid: int) -> bool: ...
@@ -74,8 +74,9 @@ if sys.platform == "win32":
74
74
 
75
75
  class WindowsSelectorEventLoopPolicy(events.BaseDefaultEventLoopPolicy):
76
76
  _loop_factory: ClassVar[type[SelectorEventLoop]]
77
- def get_child_watcher(self) -> NoReturn: ...
78
- def set_child_watcher(self, watcher: Any) -> NoReturn: ...
77
+ if sys.version_info < (3, 14):
78
+ def get_child_watcher(self) -> NoReturn: ...
79
+ def set_child_watcher(self, watcher: Any) -> NoReturn: ...
79
80
 
80
81
  class WindowsProactorEventLoopPolicy(events.BaseDefaultEventLoopPolicy):
81
82
  _loop_factory: ClassVar[type[ProactorEventLoop]]