Skip to content

Commit 6ecd830

Browse files
authored
Merge branch 'main' into patch-6
2 parents 592d4fc + db9c181 commit 6ecd830

20 files changed

Lines changed: 215 additions & 94 deletions

File tree

stdlib/@tests/stubtest_allowlists/linux-py315.txt

Lines changed: 4 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,11 @@
1-
# ============================================
2-
# TODO: Allowlist entries that should be fixed
3-
# ============================================
1+
# =============================================================
2+
# Allowlist entries that cannot or should not be fixed; >= 3.15
3+
# =============================================================
44

55
# GitHub Actions' Python 3.15 Linux build currently lacks _decimal, so
66
# decimal falls back to _pydecimal with different runtime signatures.
7-
decimal\..*
87
_decimal
9-
os.AT_NO_AUTOMOUNT
10-
os.AT_STATX_DONT_SYNC
11-
os.AT_STATX_FORCE_SYNC
12-
os.AT_STATX_SYNC_AS_STAT
13-
os.STATX_ATIME
14-
os.STATX_BASIC_STATS
15-
os.STATX_BLOCKS
16-
os.STATX_BTIME
17-
os.STATX_CTIME
18-
os.STATX_DIOALIGN
19-
os.STATX_GID
20-
os.STATX_INO
21-
os.STATX_MNT_ID
22-
os.STATX_MNT_ID_UNIQUE
23-
os.STATX_MODE
24-
os.STATX_MTIME
25-
os.STATX_NLINK
26-
os.STATX_SIZE
27-
os.STATX_TYPE
28-
os.STATX_UID
29-
os.__all__
30-
os._clearenv
31-
os.statx
32-
os.statx_result
33-
posix.AT_NO_AUTOMOUNT
34-
posix.AT_STATX_DONT_SYNC
35-
posix.AT_STATX_FORCE_SYNC
36-
posix.AT_STATX_SYNC_AS_STAT
37-
posix.STATX_ATIME
38-
posix.STATX_BASIC_STATS
39-
posix.STATX_BLOCKS
40-
posix.STATX_BTIME
41-
posix.STATX_CTIME
42-
posix.STATX_DIOALIGN
43-
posix.STATX_GID
44-
posix.STATX_INO
45-
posix.STATX_MNT_ID
46-
posix.STATX_MNT_ID_UNIQUE
47-
posix.STATX_MODE
48-
posix.STATX_MTIME
49-
posix.STATX_NLINK
50-
posix.STATX_SIZE
51-
posix.STATX_TYPE
52-
posix.STATX_UID
53-
posix.statx
54-
55-
56-
# =============================================================
57-
# Allowlist entries that cannot or should not be fixed; >= 3.15
58-
# =============================================================
8+
decimal\..*
599

6010
# Depends on how readline was built.
6111
readline.get_pre_input_hook

stdlib/@tests/stubtest_allowlists/py315.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ _struct.pack_into
1818
_thread.RLock.__exit__
1919
_thread.lock.__exit__
2020
copy.deepcopy
21-
dataclasses._MISSING_TYPE
2221
dataclasses.MISSING
22+
dataclasses._MISSING_TYPE
2323
dataclasses.field
2424
doctest.DocTestRunner.report_skip
25-
enum.__all__
2625
importlib._abc.Loader.load_module
2726
importlib._bootstrap_external.NamespacePath
2827
importlib.abc.InspectLoader.source_to_code
@@ -37,9 +36,6 @@ threading.Condition.locked
3736
tkinter.Image.__iter__
3837
tkinter.Misc.__iter__
3938
tkinter.font.Font.__iter__
40-
tkinter.simpledialog.__all__
41-
typing_extensions.__all__
42-
xml.etree.ElementTree.__all__
4339

4440
# =============================================================
4541
# Allowlist entries that cannot or should not be fixed; >= 3.15
@@ -50,6 +46,9 @@ base64.b64decode
5046
urllib.parse.urlunparse
5147
urllib.parse.urlunsplit
5248

49+
# Runtime __all__ includes no_type_check_decorator, but the attribute does not exist on Python 3.15.
50+
typing_extensions.__all__
51+
5352
# Internal implementation details of the sampling profiler.
5453
profiling.sampling.binary_collector
5554
profiling.sampling.binary_reader

stdlib/@tests/stubtest_allowlists/win32-py315.txt

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
1-
# ============================================
2-
# TODO: Allowlist entries that should be fixed
3-
# ============================================
4-
5-
_winapi.DeregisterEventSource
6-
_winapi.EVENTLOG_AUDIT_FAILURE
7-
_winapi.EVENTLOG_AUDIT_SUCCESS
8-
_winapi.EVENTLOG_ERROR_TYPE
9-
_winapi.EVENTLOG_INFORMATION_TYPE
10-
_winapi.EVENTLOG_SUCCESS
11-
_winapi.EVENTLOG_WARNING_TYPE
12-
_winapi.GetOEMCP
13-
_winapi.RegisterEventSource
14-
_winapi.ReportEvent
15-
winreg.DeleteTree
16-
17-
181
# =============================================================
192
# Allowlist entries that cannot or should not be fixed; >= 3.15
203
# =============================================================

stdlib/_heapq.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ from typing import Final
44

55
__about__: Final[str]
66

7-
def heapify(heap: list[_T], /) -> None: ...
7+
def heapify(heap: list[_T], /) -> None: ... # To work around the fact that list is invariant
88
def heappop(heap: list[_T], /) -> _T: ...
99
def heappush(heap: list[_T], item: _T, /) -> None: ...
1010
def heappushpop(heap: list[_T], item: _T, /) -> _T: ...

stdlib/_typeshed/__init__.pyi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,10 +351,12 @@ AnyOrLiteralStr = TypeVar("AnyOrLiteralStr", str, bytes, LiteralString) # noqa:
351351
StrOrLiteralStr = TypeVar("StrOrLiteralStr", LiteralString, str) # noqa: Y001
352352

353353
# Objects suitable to be passed to sys.setprofile, threading.setprofile, and similar
354-
ProfileFunction: TypeAlias = Callable[[FrameType, str, Any], object]
354+
ProfileFunction: TypeAlias = Callable[[FrameType, Literal["call", "return", "c_call", "c_return", "c_exception"], Any], object]
355355

356356
# Objects suitable to be passed to sys.settrace, threading.settrace, and similar
357-
TraceFunction: TypeAlias = Callable[[FrameType, str, Any], TraceFunction | None]
357+
TraceFunction: TypeAlias = Callable[
358+
[FrameType, Literal["call", "line", "return", "exception", "opcode"], Any], TraceFunction | None
359+
]
358360

359361
# experimental
360362
# Might not work as expected for pyright, see

stdlib/_winapi.pyi

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ if sys.platform == "win32":
2929
ERROR_PIPE_CONNECTED: Final = 535
3030
ERROR_SEM_TIMEOUT: Final = 121
3131

32+
if sys.version_info >= (3, 15):
33+
EVENTLOG_AUDIT_FAILURE: Final = 16
34+
EVENTLOG_AUDIT_SUCCESS: Final = 8
35+
EVENTLOG_ERROR_TYPE: Final = 1
36+
EVENTLOG_INFORMATION_TYPE: Final = 4
37+
EVENTLOG_SUCCESS: Final = 0
38+
EVENTLOG_WARNING_TYPE: Final = 2
39+
3240
FILE_FLAG_FIRST_PIPE_INSTANCE: Final = 0x80000
3341
FILE_FLAG_OVERLAPPED: Final = 0x40000000
3442

@@ -232,6 +240,10 @@ if sys.platform == "win32":
232240
) -> int: ...
233241
def ExitProcess(ExitCode: int, /) -> NoReturn: ...
234242
def GetACP() -> int: ...
243+
if sys.version_info >= (3, 15):
244+
def DeregisterEventSource(handle: int, /) -> None: ...
245+
def GetOEMCP() -> int: ...
246+
235247
def GetFileType(handle: int) -> int: ...
236248
def GetCurrentProcess() -> int: ...
237249
def GetExitCodeProcess(process: int, /) -> int: ...
@@ -245,6 +257,10 @@ if sys.platform == "win32":
245257
def OpenProcess(desired_access: int, inherit_handle: bool, process_id: int, /) -> int: ...
246258
def PeekNamedPipe(handle: int, size: int = 0, /) -> tuple[int, int] | tuple[bytes, int, int]: ...
247259
def LCMapStringEx(locale: str, flags: int, src: str) -> str: ...
260+
if sys.version_info >= (3, 15):
261+
def RegisterEventSource(unc_server_name: str | None, source_name: str, /) -> int: ...
262+
def ReportEvent(handle: int, type: int, category: int, event_id: int, string: str, /) -> None: ...
263+
248264
def UnmapViewOfFile(address: int, /) -> None: ...
249265

250266
@overload

stdlib/asyncio/base_events.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class BaseEventLoop(AbstractEventLoop):
115115
type: int = 0,
116116
proto: int = 0,
117117
flags: int = 0,
118-
) -> list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int]]]: ...
118+
) -> list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int] | tuple[int, bytes]]]: ...
119119
async def getnameinfo(self, sockaddr: tuple[str, int] | tuple[str, int, int, int], flags: int = 0) -> tuple[str, str]: ...
120120

121121
if sys.version_info >= (3, 12):

stdlib/asyncio/events.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ class AbstractEventLoop:
205205
type: int = 0,
206206
proto: int = 0,
207207
flags: int = 0,
208-
) -> list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int]]]: ...
208+
) -> list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int] | tuple[int, bytes]]]: ...
209209
@abstractmethod
210210
async def getnameinfo(self, sockaddr: tuple[str, int] | tuple[str, int, int, int], flags: int = 0) -> tuple[str, str]: ...
211211

stdlib/asyncio/runners.pyi

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ if sys.version_info >= (3, 11):
2727
else:
2828
def run(self, coro: Coroutine[Any, Any, _T], *, context: Context | None = None) -> _T: ...
2929

30-
if sys.version_info >= (3, 12):
30+
if sys.version_info >= (3, 14):
31+
def run(
32+
main: Awaitable[_T], *, debug: bool | None = None, loop_factory: Callable[[], AbstractEventLoop] | None = None
33+
) -> _T: ...
34+
35+
elif sys.version_info >= (3, 12):
3136
def run(
3237
main: Coroutine[Any, Any, _T], *, debug: bool | None = None, loop_factory: Callable[[], AbstractEventLoop] | None = None
3338
) -> _T: ...

stdlib/enum.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ if sys.version_info >= (3, 11):
3737

3838
if sys.version_info >= (3, 13):
3939
__all__ += ["EnumDict"]
40+
if sys.version_info >= (3, 15):
41+
__all__ += ["show_flag_values", "bin"]
4042

4143
_EnumMemberT = TypeVar("_EnumMemberT")
4244
_EnumerationT = TypeVar("_EnumerationT", bound=type[Enum])

0 commit comments

Comments
 (0)