Skip to content

Commit 948aeb8

Browse files
Update to Python 3.15b3 (#15939)
* Update to Python 3.15b3 * [pre-commit.ci] auto fixes from pre-commit.com hooks * Fix "type aliases" * Remove allowlist entries * Remove version guards --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 4f83f4c commit 948aeb8

4 files changed

Lines changed: 116 additions & 38 deletions

File tree

stdlib/@tests/stubtest_allowlists/py315.txt

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -56,24 +56,6 @@ profiling.sampling.cli
5656
profiling.sampling.constants
5757
profiling.sampling.dump
5858
profiling.sampling.errors
59-
profiling.sampling.gecko_collector.CATEGORY_CODE_TYPE
60-
profiling.sampling.gecko_collector.CATEGORY_CPU
61-
profiling.sampling.gecko_collector.CATEGORY_EXCEPTION
62-
profiling.sampling.gecko_collector.CATEGORY_GC
63-
profiling.sampling.gecko_collector.CATEGORY_GIL
64-
profiling.sampling.gecko_collector.CATEGORY_NATIVE
65-
profiling.sampling.gecko_collector.CATEGORY_OPCODES
66-
profiling.sampling.gecko_collector.CATEGORY_OTHER
67-
profiling.sampling.gecko_collector.CATEGORY_PYTHON
68-
profiling.sampling.gecko_collector.DEFAULT_SUBCATEGORY
69-
profiling.sampling.gecko_collector.FRAME_ADDRESS_NONE
70-
profiling.sampling.gecko_collector.FRAME_INLINE_DEPTH_ROOT
71-
profiling.sampling.gecko_collector.GECKO_CATEGORIES
72-
profiling.sampling.gecko_collector.GECKO_FORMAT_VERSION
73-
profiling.sampling.gecko_collector.GECKO_PREPROCESSED_VERSION
74-
profiling.sampling.gecko_collector.PROCESS_TYPE_MAIN
75-
profiling.sampling.gecko_collector.RESOURCE_TYPE_LIBRARY
76-
profiling.sampling.gecko_collector.STACKWALK_DISABLED
7759
profiling.sampling.heatmap_collector.FileStats
7860
profiling.sampling.heatmap_collector.TreeNode
7961
profiling.sampling.module_utils

stdlib/VERSIONS

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,6 @@ posixpath: 3.0-
245245
pprint: 3.0-
246246
profile: 3.0-
247247
profiling: 3.15-
248-
profiling.sampling: 3.15-
249-
profiling.tracing: 3.15-
250248
pstats: 3.0-
251249
pty: 3.0-
252250
pwd: 3.0-

stdlib/_curses.pyi

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ class window: # undocumented
423423
def chgat(self, y: int, x: int, num: int, attr: int) -> None: ...
424424

425425
def clear(self) -> None: ...
426-
def clearok(self, yes: int) -> None: ...
426+
def clearok(self, flag: bool, /) -> None: ...
427427
def clrtobot(self) -> None: ...
428428
def clrtoeol(self) -> None: ...
429429
def cursyncup(self) -> None: ...
@@ -480,9 +480,9 @@ class window: # undocumented
480480
@overload
481481
def hline(self, y: int, x: int, ch: _ChType, n: int) -> None: ...
482482

483-
def idcok(self, flag: bool) -> None: ...
484-
def idlok(self, yes: bool) -> None: ...
485-
def immedok(self, flag: bool) -> None: ...
483+
def idcok(self, flag: bool, /) -> None: ...
484+
def idlok(self, flag: bool, /) -> None: ...
485+
def immedok(self, flag: bool, /) -> None: ...
486486

487487
@overload
488488
def inch(self) -> int: ...
@@ -494,7 +494,7 @@ class window: # undocumented
494494
@overload
495495
def insch(self, y: int, x: int, ch: _ChType, attr: int = ...) -> None: ...
496496

497-
def insdelln(self, nlines: int) -> None: ...
497+
def insdelln(self, nlines: int, /) -> None: ...
498498
def insertln(self) -> None: ...
499499

500500
@overload
@@ -514,13 +514,13 @@ class window: # undocumented
514514

515515
def is_linetouched(self, line: int, /) -> bool: ...
516516
def is_wintouched(self) -> bool: ...
517-
def keypad(self, yes: bool, /) -> None: ...
518-
def leaveok(self, yes: bool) -> None: ...
519-
def move(self, new_y: int, new_x: int) -> None: ...
520-
def mvderwin(self, y: int, x: int) -> None: ...
521-
def mvwin(self, new_y: int, new_x: int) -> None: ...
522-
def nodelay(self, yes: bool) -> None: ...
523-
def notimeout(self, yes: bool) -> None: ...
517+
def keypad(self, flag: bool, /) -> None: ...
518+
def leaveok(self, flag: bool, /) -> None: ...
519+
def move(self, new_y: int, new_x: int, /) -> None: ...
520+
def mvderwin(self, y: int, x: int, /) -> None: ...
521+
def mvwin(self, new_y: int, new_x: int, /) -> None: ...
522+
def nodelay(self, flag: bool, /) -> None: ...
523+
def notimeout(self, flag: bool, /) -> None: ...
524524

525525
@overload
526526
def noutrefresh(self) -> None: ...
@@ -550,9 +550,9 @@ class window: # undocumented
550550
@overload
551551
def refresh(self, pminrow: int, pmincol: int, sminrow: int, smincol: int, smaxrow: int, smaxcol: int) -> None: ...
552552

553-
def resize(self, nlines: int, ncols: int) -> None: ...
553+
def resize(self, nlines: int, ncols: int, /) -> None: ...
554554
def scroll(self, lines: int = 1) -> None: ...
555-
def scrollok(self, flag: bool) -> None: ...
555+
def scrollok(self, flag: bool, /) -> None: ...
556556
def setscrreg(self, top: int, bottom: int, /) -> None: ...
557557
def standend(self) -> None: ...
558558
def standout(self) -> None: ...
@@ -568,9 +568,9 @@ class window: # undocumented
568568
def subwin(self, nlines: int, ncols: int, begin_y: int, begin_x: int) -> window: ...
569569

570570
def syncdown(self) -> None: ...
571-
def syncok(self, flag: bool) -> None: ...
571+
def syncok(self, flag: bool, /) -> None: ...
572572
def syncup(self) -> None: ...
573-
def timeout(self, delay: int) -> None: ...
573+
def timeout(self, delay: int, /) -> None: ...
574574
def touchline(self, start: int, count: int, changed: bool = True) -> None: ...
575575
def touchwin(self) -> None: ...
576576
def untouchwin(self) -> None: ...

stdlib/profiling/sampling/gecko_collector.pyi

Lines changed: 100 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,109 @@
1-
from _typeshed import StrOrBytesPath
2-
from collections.abc import Sequence
1+
from _typeshed import Incomplete, StrOrBytesPath, StrPath
2+
from collections.abc import Generator, Sequence
3+
from tempfile import TemporaryDirectory
4+
from typing import Any, ClassVar, Final, TypedDict, type_check_only
35

46
from _remote_debugging import AwaitedInfo, InterpreterInfo
57

68
from .collector import Collector, _Timestamps
79

10+
@type_check_only
11+
class _GeckoCategory(TypedDict):
12+
name: str
13+
color: str
14+
subcategories: list[str]
15+
16+
THREAD_STATUS_HAS_GIL: Final[int]
17+
THREAD_STATUS_ON_CPU: Final[int]
18+
THREAD_STATUS_UNKNOWN: Final[int]
19+
THREAD_STATUS_GIL_REQUESTED: Final[int]
20+
THREAD_STATUS_HAS_EXCEPTION: Final[int]
21+
THREAD_STATUS_MAIN_THREAD: Final[int]
22+
23+
GECKO_CATEGORIES: Final[list[_GeckoCategory]]
24+
25+
CATEGORY_OTHER: Final = 0
26+
CATEGORY_PYTHON: Final = 1
27+
CATEGORY_NATIVE: Final = 2
28+
CATEGORY_GC: Final = 3
29+
CATEGORY_GIL: Final = 4
30+
CATEGORY_CPU: Final = 5
31+
CATEGORY_CODE_TYPE: Final = 6
32+
CATEGORY_OPCODES: Final = 7
33+
CATEGORY_EXCEPTION: Final = 8
34+
35+
DEFAULT_SUBCATEGORY: Final = 0
36+
37+
GECKO_FORMAT_VERSION: Final = 32
38+
GECKO_PREPROCESSED_VERSION: Final = 57
39+
40+
RESOURCE_TYPE_LIBRARY: Final = 1
41+
42+
FRAME_ADDRESS_NONE: Final = -1
43+
FRAME_INLINE_DEPTH_ROOT: Final = 0
44+
45+
PROCESS_TYPE_MAIN: Final = 0
46+
STACKWALK_DISABLED: Final = 0
47+
48+
DEFAULT_SPILL_BUFFER_BYTES: Final[int]
49+
50+
class SpillColumn:
51+
path: str
52+
buffer: bytearray
53+
54+
def __init__(self, directory: StrPath, basename: StrPath, *, buffer_bytes: int | None = None) -> None: ...
55+
# "value" accepts the same types as json.JSONEncoder.encode()
56+
def append(self, value: Any) -> None: ...
57+
def flush(self) -> None: ...
58+
def iter_tokens(self) -> Generator[str]: ...
59+
60+
class GeckoThreadSpill:
61+
sample_count: int
62+
marker_count: int
63+
def __init__(self, directory: StrPath, tid: int) -> None: ...
64+
def append_sample(self, stack_index: int, time_ms: float) -> None: ...
65+
def append_marker(
66+
self, name_idx: int, start_time: float, end_time: float, phase: int, category: int, data: dict[str, Any]
67+
) -> None: ...
68+
def prepare_read(self) -> None: ...
69+
870
class GeckoCollector(Collector):
71+
aggregating: ClassVar[bool]
72+
73+
sample_interval_usec: int
74+
skip_idle: bool
75+
opcodes_enabled: bool
76+
start_time: float
77+
78+
global_strings: list[str]
79+
global_string_map: dict[str, int]
80+
81+
threads: dict[int, dict[str, Any]]
82+
spill_dir: TemporaryDirectory[str] | None
83+
exported: bool
84+
85+
libs: list[Incomplete]
86+
87+
sample_count: int
88+
last_sample_time: float
89+
interval: float
90+
91+
has_gil_start: dict[Incomplete, Incomplete]
92+
no_gil_start: dict[Incomplete, Incomplete]
93+
on_cpu_start: dict[Incomplete, Incomplete]
94+
off_cpu_start: dict[Incomplete, Incomplete]
95+
python_code_start: dict[Incomplete, Incomplete]
96+
native_code_start: dict[Incomplete, Incomplete]
97+
gil_wait_start: dict[Incomplete, Incomplete]
98+
exception_start: dict[Incomplete, Incomplete]
99+
no_exception_start: dict[Incomplete, Incomplete]
100+
101+
gc_start_per_thread: dict[int, float]
102+
103+
initialized_threads: set[Incomplete]
104+
105+
opcode_state: dict[int, tuple[Incomplete, int, int, str, str, float]]
106+
9107
def __init__(self, sample_interval_usec: int, *, skip_idle: bool = False, opcodes: bool = False) -> None: ...
10108
def collect(
11109
self, stack_frames: Sequence[InterpreterInfo] | Sequence[AwaitedInfo], timestamps_us: _Timestamps = None

0 commit comments

Comments
 (0)