Skip to content

Commit 999da2e

Browse files
Merge branch 'main' into 13881-fix-compile-filename-typing
2 parents 44d2f90 + 6588a81 commit 999da2e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+113
-1204
lines changed

pyrightconfig.stricter.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"stubs/braintree",
3636
"stubs/cffi",
3737
"stubs/click-web",
38-
"stubs/corus",
3938
"stubs/dateparser",
4039
"stubs/defusedxml",
4140
"stubs/docker",

stdlib/@tests/stubtest_allowlists/py314.txt

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
# TODO: New errors in Python 3.14 that need to be fixed or moved below
33
# ====================================================================
44

5-
_asyncio.all_tasks
6-
_imp.pyc_magic_number_token
7-
_thread.RLock.locked
8-
_thread.set_name
95
asyncio.eager_task_factory
106
asyncio.tasks.eager_task_factory
117
compression.gzip.GzipFile.readinto
@@ -19,7 +15,6 @@ fractions.Fraction.__rpow__
1915
gzip.GzipFile.readinto
2016
gzip.GzipFile.readinto1
2117
gzip.compress
22-
multiprocessing.forkserver.main
2318
multiprocessing.managers.BaseListProxy.clear
2419
multiprocessing.managers.BaseListProxy.copy
2520
multiprocessing.managers.DictProxy.__ior__
@@ -32,15 +27,6 @@ multiprocessing.process.BaseProcess.interrupt
3227
multiprocessing.synchronize.SemLock.locked
3328
tarfile.TarFile.zstopen
3429
tkinter.Event.__class_getitem__
35-
turtle.__all__
36-
turtle.RawTurtle.fill
37-
turtle.RawTurtle.poly
38-
turtle.TurtleScreen.no_animation
39-
turtle.TurtleScreen.save
40-
turtle.fill
41-
turtle.no_animation
42-
turtle.poly
43-
turtle.save
4430

4531
# =========================
4632
# New errors in Python 3.14

stdlib/_asyncio.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,4 @@ if sys.version_info >= (3, 12):
107107
if sys.version_info >= (3, 14):
108108
def future_discard_from_awaited_by(future: Future[Any], waiter: Future[Any], /) -> None: ...
109109
def future_add_to_awaited_by(future: Future[Any], waiter: Future[Any], /) -> None: ...
110+
def all_tasks(loop: AbstractEventLoop | None = None) -> set[Task[Any]]: ...

stdlib/_imp.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ from importlib.machinery import ModuleSpec
55
from typing import Any
66

77
check_hash_based_pycs: str
8+
if sys.version_info >= (3, 14):
9+
pyc_magic_number_token: int
810

911
def source_hash(key: int, source: ReadableBuffer) -> bytes: ...
1012
def create_builtin(spec: ModuleSpec, /) -> types.ModuleType: ...

stdlib/_thread.pyi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ class RLock:
1818
def release(self) -> None: ...
1919
__enter__ = acquire
2020
def __exit__(self, t: type[BaseException] | None, v: BaseException | None, tb: TracebackType | None) -> None: ...
21+
if sys.version_info >= (3, 14):
22+
def locked(self) -> bool: ...
2123

2224
if sys.version_info >= (3, 13):
2325
@final
@@ -105,6 +107,9 @@ _excepthook: Callable[[_ExceptHookArgs], Any]
105107
if sys.version_info >= (3, 12):
106108
def daemon_threads_allowed() -> bool: ...
107109

110+
if sys.version_info >= (3, 14):
111+
def set_name(name: str) -> None: ...
112+
108113
class _local:
109114
def __getattribute__(self, name: str, /) -> Any: ...
110115
def __setattr__(self, name: str, value: Any, /) -> None: ...

stdlib/_typeshed/__init__.pyi

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,6 @@ class SupportsGetItemBuffer(SliceableBuffer, IndexableBuffer, Protocol):
298298

299299
class SizedBuffer(Sized, Buffer, Protocol): ...
300300

301-
# for compatibility with third-party stubs that may use this
302-
_BufferWithLen: TypeAlias = SizedBuffer # not stable # noqa: Y047
303-
304301
ExcInfo: TypeAlias = tuple[type[BaseException], BaseException, TracebackType]
305302
OptExcInfo: TypeAlias = ExcInfo | tuple[None, None, None]
306303

stdlib/ast.pyi

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,20 +1095,28 @@ if sys.version_info >= (3, 14):
10951095
**kwargs: Unpack[_Attributes],
10961096
) -> Self: ...
10971097

1098+
if sys.version_info >= (3, 10):
1099+
from types import EllipsisType
1100+
1101+
_ConstantValue: typing_extensions.TypeAlias = str | bytes | bool | int | float | complex | None | EllipsisType
1102+
else:
1103+
# Rely on builtins.ellipsis
1104+
_ConstantValue: typing_extensions.TypeAlias = str | bytes | bool | int | float | complex | None | ellipsis # noqa: F821
1105+
10981106
class Constant(expr):
10991107
if sys.version_info >= (3, 10):
11001108
__match_args__ = ("value", "kind")
1101-
value: Any # None, str, bytes, bool, int, float, complex, Ellipsis
1109+
value: _ConstantValue
11021110
kind: str | None
11031111
if sys.version_info < (3, 14):
11041112
# Aliases for value, for backwards compatibility
1105-
s: Any
1106-
n: int | float | complex
1113+
s: _ConstantValue
1114+
n: _ConstantValue
11071115

1108-
def __init__(self, value: Any, kind: str | None = None, **kwargs: Unpack[_Attributes]) -> None: ...
1116+
def __init__(self, value: _ConstantValue, kind: str | None = None, **kwargs: Unpack[_Attributes]) -> None: ...
11091117

11101118
if sys.version_info >= (3, 14):
1111-
def __replace__(self, *, value: Any = ..., kind: str | None = ..., **kwargs: Unpack[_Attributes]) -> Self: ...
1119+
def __replace__(self, *, value: _ConstantValue = ..., kind: str | None = ..., **kwargs: Unpack[_Attributes]) -> Self: ...
11121120

11131121
class Attribute(expr):
11141122
if sys.version_info >= (3, 10):

stdlib/multiprocessing/forkserver.pyi

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
from _typeshed import FileDescriptorLike, Unused
23
from collections.abc import Sequence
34
from struct import Struct
@@ -14,13 +15,26 @@ class ForkServer:
1415
def connect_to_new_process(self, fds: Sequence[int]) -> tuple[int, int]: ...
1516
def ensure_running(self) -> None: ...
1617

17-
def main(
18-
listener_fd: int | None,
19-
alive_r: FileDescriptorLike,
20-
preload: Sequence[str],
21-
main_path: str | None = None,
22-
sys_path: Unused = None,
23-
) -> None: ...
18+
if sys.version_info >= (3, 14):
19+
def main(
20+
listener_fd: int | None,
21+
alive_r: FileDescriptorLike,
22+
preload: Sequence[str],
23+
main_path: str | None = None,
24+
sys_path: list[str] | None = None,
25+
*,
26+
authkey_r: int | None = None,
27+
) -> None: ...
28+
29+
else:
30+
def main(
31+
listener_fd: int | None,
32+
alive_r: FileDescriptorLike,
33+
preload: Sequence[str],
34+
main_path: str | None = None,
35+
sys_path: Unused = None,
36+
) -> None: ...
37+
2438
def read_signed(fd: int) -> Any: ...
2539
def write_signed(fd: int, n: int) -> None: ...
2640

stdlib/turtle.pyi

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import sys
2-
from collections.abc import Callable, Sequence
2+
from _typeshed import StrPath
3+
from collections.abc import Callable, Generator, Sequence
4+
from contextlib import contextmanager
35
from tkinter import Canvas, Frame, Misc, PhotoImage, Scrollbar
46
from typing import Any, ClassVar, Literal, TypedDict, overload
57
from typing_extensions import Self, TypeAlias
@@ -128,6 +130,9 @@ __all__ = [
128130
"Terminator",
129131
]
130132

133+
if sys.version_info >= (3, 14):
134+
__all__ += ["fill", "no_animation", "poly", "save"]
135+
131136
if sys.version_info >= (3, 12):
132137
__all__ += ["teleport"]
133138

@@ -231,6 +236,10 @@ class TurtleScreen(TurtleScreenBase):
231236
def delay(self, delay: None = None) -> int: ...
232237
@overload
233238
def delay(self, delay: int) -> None: ...
239+
if sys.version_info >= (3, 14):
240+
@contextmanager
241+
def no_animation(self) -> Generator[None]: ...
242+
234243
def update(self) -> None: ...
235244
def window_width(self) -> int: ...
236245
def window_height(self) -> int: ...
@@ -249,6 +258,8 @@ class TurtleScreen(TurtleScreenBase):
249258
# Looks like if self.cv is not a ScrolledCanvas, this could return a tuple as well
250259
@overload
251260
def screensize(self, canvwidth: int, canvheight: int, bg: _Color | None = None) -> None: ...
261+
if sys.version_info >= (3, 14):
262+
def save(self, filename: StrPath, *, overwrite: bool = False) -> None: ...
252263
onscreenclick = onclick
253264
resetscreen = reset
254265
clearscreen = clear
@@ -428,12 +439,20 @@ class RawTurtle(TPen, TNavigator): # type: ignore[misc] # Conflicting methods
428439
def clearstamp(self, stampid: int | tuple[int, ...]) -> None: ...
429440
def clearstamps(self, n: int | None = None) -> None: ...
430441
def filling(self) -> bool: ...
442+
if sys.version_info >= (3, 14):
443+
@contextmanager
444+
def fill(self) -> Generator[None]: ...
445+
431446
def begin_fill(self) -> None: ...
432447
def end_fill(self) -> None: ...
433448
def dot(self, size: int | None = None, *color: _Color) -> None: ...
434449
def write(
435450
self, arg: object, move: bool = False, align: str = "left", font: tuple[str, int, str] = ("Arial", 8, "normal")
436451
) -> None: ...
452+
if sys.version_info >= (3, 14):
453+
@contextmanager
454+
def poly(self) -> Generator[None]: ...
455+
437456
def begin_poly(self) -> None: ...
438457
def end_poly(self) -> None: ...
439458
def get_poly(self) -> _PolygonCoords | None: ...
@@ -516,6 +535,11 @@ def tracer(n: int, delay: int | None = None) -> None: ...
516535
def delay(delay: None = None) -> int: ...
517536
@overload
518537
def delay(delay: int) -> None: ...
538+
539+
if sys.version_info >= (3, 14):
540+
@contextmanager
541+
def no_animation() -> Generator[None]: ...
542+
519543
def update() -> None: ...
520544
def window_width() -> int: ...
521545
def window_height() -> int: ...
@@ -534,6 +558,9 @@ def screensize(canvwidth: None = None, canvheight: None = None, bg: None = None)
534558
@overload
535559
def screensize(canvwidth: int, canvheight: int, bg: _Color | None = None) -> None: ...
536560

561+
if sys.version_info >= (3, 14):
562+
def save(filename: StrPath, *, overwrite: bool = False) -> None: ...
563+
537564
onscreenclick = onclick
538565
resetscreen = reset
539566
clearscreen = clear
@@ -705,10 +732,20 @@ def stamp() -> Any: ...
705732
def clearstamp(stampid: int | tuple[int, ...]) -> None: ...
706733
def clearstamps(n: int | None = None) -> None: ...
707734
def filling() -> bool: ...
735+
736+
if sys.version_info >= (3, 14):
737+
@contextmanager
738+
def fill() -> Generator[None]: ...
739+
708740
def begin_fill() -> None: ...
709741
def end_fill() -> None: ...
710742
def dot(size: int | None = None, *color: _Color) -> None: ...
711743
def write(arg: object, move: bool = False, align: str = "left", font: tuple[str, int, str] = ("Arial", 8, "normal")) -> None: ...
744+
745+
if sys.version_info >= (3, 14):
746+
@contextmanager
747+
def poly() -> Generator[None]: ...
748+
712749
def begin_poly() -> None: ...
713750
def end_poly() -> None: ...
714751
def get_poly() -> _PolygonCoords | None: ...

stubs/corus/METADATA.toml

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)