Skip to content

Commit be6d228

Browse files
committed
Merge remote-tracking branch 'upstream/main' into async-tachyon
2 parents 36c8b3c + 6462322 commit be6d228

33 files changed

Lines changed: 1511 additions & 1499 deletions

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,17 @@ updates:
1212
update-types:
1313
- "version-update:semver-minor"
1414
- "version-update:semver-patch"
15+
cooldown:
16+
# https://blog.yossarian.net/2025/11/21/We-should-all-be-using-dependency-cooldowns
17+
# Cooldowns protect against supply chain attacks by avoiding the
18+
# highest-risk window immediately after new releases.
19+
default-days: 14
1520
- package-ecosystem: "pip"
1621
directory: "/Tools/"
1722
schedule:
1823
interval: "monthly"
1924
labels:
2025
- "skip issue"
2126
- "skip news"
27+
cooldown:
28+
default-days: 14

Doc/library/math.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ Summation and product functions
506506

507507
Roughly equivalent to::
508508

509-
sqrt(sum((px - qx) ** 2.0 for px, qx in zip(p, q)))
509+
sqrt(sum((px - qx) ** 2.0 for px, qx in zip(p, q, strict=True)))
510510

511511
.. versionadded:: 3.8
512512

Doc/library/profile.rst

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -347,81 +347,6 @@ The statistical profiler produces output similar to deterministic profilers but
347347

348348
.. _profile-cli:
349349

350-
:mod:`!profiling.sampling` Module Reference
351-
=======================================================
352-
353-
.. module:: profiling.sampling
354-
:synopsis: Python statistical profiler.
355-
356-
This section documents the programmatic interface for the :mod:`!profiling.sampling` module.
357-
For command-line usage, see :ref:`sampling-profiler-cli`. For conceptual information
358-
about statistical profiling, see :ref:`statistical-profiling`
359-
360-
.. function:: sample(pid, *, sort=2, sample_interval_usec=100, duration_sec=10, filename=None, all_threads=False, limit=None, show_summary=True, output_format="pstats", realtime_stats=False, native=False, gc=True)
361-
362-
Sample a Python process and generate profiling data.
363-
364-
This is the main entry point for statistical profiling. It creates a
365-
:class:`SampleProfiler`, collects stack traces from the target process, and
366-
outputs the results in the specified format.
367-
368-
:param int pid: Process ID of the target Python process
369-
:param int sort: Sort order for pstats output (default: 2 for cumulative time)
370-
:param int sample_interval_usec: Sampling interval in microseconds (default: 100)
371-
:param int duration_sec: Duration to sample in seconds (default: 10)
372-
:param str filename: Output filename (None for stdout/default naming)
373-
:param bool all_threads: Whether to sample all threads (default: False)
374-
:param int limit: Maximum number of functions to display (default: None)
375-
:param bool show_summary: Whether to show summary statistics (default: True)
376-
:param str output_format: Output format - 'pstats' or 'collapsed' (default: 'pstats')
377-
:param bool realtime_stats: Whether to display real-time statistics (default: False)
378-
:param bool native: Whether to include ``<native>`` frames (default: False)
379-
:param bool gc: Whether to include ``<GC>`` frames (default: True)
380-
381-
:raises ValueError: If output_format is not 'pstats' or 'collapsed'
382-
383-
Examples::
384-
385-
# Basic usage - profile process 1234 for 10 seconds
386-
import profiling.sampling
387-
profiling.sampling.sample(1234)
388-
389-
# Profile with custom settings
390-
profiling.sampling.sample(1234, duration_sec=30, sample_interval_usec=50, all_threads=True)
391-
392-
# Generate collapsed stack traces for flamegraph.pl
393-
profiling.sampling.sample(1234, output_format='collapsed', filename='profile.collapsed')
394-
395-
.. class:: SampleProfiler(pid, sample_interval_usec, all_threads)
396-
397-
Low-level API for the statistical profiler.
398-
399-
This profiler uses periodic stack sampling to collect performance data
400-
from running Python processes with minimal overhead. It can attach to
401-
any Python process by PID and collect stack traces at regular intervals.
402-
403-
:param int pid: Process ID of the target Python process
404-
:param int sample_interval_usec: Sampling interval in microseconds
405-
:param bool all_threads: Whether to sample all threads or just the main thread
406-
407-
.. method:: sample(collector, duration_sec=10)
408-
409-
Sample the target process for the specified duration.
410-
411-
Collects stack traces from the target process at regular intervals
412-
and passes them to the provided collector for processing.
413-
414-
:param collector: Object that implements ``collect()`` method to process stack traces
415-
:param int duration_sec: Duration to sample in seconds (default: 10)
416-
417-
The method tracks sampling statistics and can display real-time
418-
information if realtime_stats is enabled.
419-
420-
.. seealso::
421-
422-
:ref:`sampling-profiler-cli`
423-
Command-line interface documentation for the statistical profiler.
424-
425350
Deterministic Profiler Command Line Interface
426351
=============================================
427352

Doc/library/stdtypes.rst

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2073,9 +2073,18 @@ expression support in the :mod:`re` module).
20732073
Return ``True`` if all characters in the string are decimal
20742074
characters and there is at least one character, ``False``
20752075
otherwise. Decimal characters are those that can be used to form
2076-
numbers in base 10, e.g. U+0660, ARABIC-INDIC DIGIT
2076+
numbers in base 10, such as U+0660, ARABIC-INDIC DIGIT
20772077
ZERO. Formally a decimal character is a character in the Unicode
2078-
General Category "Nd".
2078+
General Category "Nd". For example:
2079+
2080+
.. doctest::
2081+
2082+
>>> '0123456789'.isdecimal()
2083+
True
2084+
>>> '٠١٢٣٤٥٦٧٨٩'.isdecimal() # Arabic-Indic digits zero to nine
2085+
True
2086+
>>> 'alphabetic'.isdecimal()
2087+
False
20792088

20802089

20812090
.. method:: str.isdigit()

Doc/tools/templates/dummy.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727

2828
In extensions/changes.py:
2929

30-
{% trans %}Deprecated since version {deprecated}, will be removed in version {removed}{% endtrans %}
31-
{% trans %}Deprecated since version {deprecated}, removed in version {removed}{% endtrans %}
30+
{% trans %}Deprecated since version %s, will be removed in version %s{% endtrans %}
31+
{% trans %}Deprecated since version %s, removed in version %s{% endtrans %}
3232

3333
In docsbuild-scripts, when rewriting indexsidebar.html with actual versions:
3434

Lib/_colorize.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ class Argparse(ThemeSection):
168168
short_option: str = ANSIColors.BOLD_GREEN
169169
label: str = ANSIColors.BOLD_YELLOW
170170
action: str = ANSIColors.BOLD_GREEN
171+
default: str = ANSIColors.GREY
172+
default_value: str = ANSIColors.YELLOW
171173
reset: str = ANSIColors.RESET
172174
error: str = ANSIColors.BOLD_MAGENTA
173175
warning: str = ANSIColors.BOLD_YELLOW

Lib/_pyrepl/simple_interact.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import sys
3232
import code
3333
import warnings
34-
import errno
3534

3635
from .readline import _get_reader, multiline_input, append_history_file
3736

Lib/argparse.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,14 @@ def _get_help_string(self, action):
748748
if action.default is not SUPPRESS:
749749
defaulting_nargs = [OPTIONAL, ZERO_OR_MORE]
750750
if action.option_strings or action.nargs in defaulting_nargs:
751-
help += _(' (default: %(default)s)')
751+
t = self._theme
752+
default_str = _(" (default: %(default)s)")
753+
prefix, suffix = default_str.split("%(default)s")
754+
help += (
755+
f" {t.default}{prefix.lstrip()}"
756+
f"{t.default_value}%(default)s"
757+
f"{t.default}{suffix}{t.reset}"
758+
)
752759
return help
753760

754761

Lib/asyncio/tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Tools to analyze tasks running in asyncio programs."""
22

3-
from collections import defaultdict, namedtuple
3+
from collections import defaultdict
44
from itertools import count
55
from enum import Enum
66
import sys

Lib/multiprocessing/forkserver.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,6 @@ def sigchld_handler(*_unused):
326326
len(fds)))
327327
child_r, child_w, *fds = fds
328328
s.close()
329-
util._flush_std_streams()
330329
pid = os.fork()
331330
if pid == 0:
332331
# Child

0 commit comments

Comments
 (0)