Skip to content

Commit 684734c

Browse files
authored
Merge branch 'python:main' into readline-fix
2 parents 8117ff7 + efde433 commit 684734c

50 files changed

Lines changed: 3524 additions & 857 deletions

Some content is hidden

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

Doc/library/itertools.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ and :term:`generators <generator>` which incur interpreter overhead.
850850

851851
def running_mean(iterable):
852852
"Yield the average of all values seen so far."
853-
# running_mean([8.5, 9.5, 7.5, 6.5]) -> 8.5 9.0 8.5 8.0
853+
# running_mean([8.5, 9.5, 7.5, 6.5]) 8.5 9.0 8.5 8.0
854854
return map(truediv, accumulate(iterable), count(1))
855855

856856
def repeatfunc(function, times=None, *args):
@@ -932,10 +932,10 @@ and :term:`generators <generator>` which incur interpreter overhead.
932932
yield element
933933

934934
def unique(iterable, key=None, reverse=False):
935-
"Yield unique elements in sorted order. Supports unhashable inputs."
936-
# unique([[1, 2], [3, 4], [1, 2]]) → [1, 2] [3, 4]
937-
sequenced = sorted(iterable, key=key, reverse=reverse)
938-
return unique_justseen(sequenced, key=key)
935+
"Yield unique elements in sorted order. Supports unhashable inputs."
936+
# unique([[1, 2], [3, 4], [1, 2]]) → [1, 2] [3, 4]
937+
sequenced = sorted(iterable, key=key, reverse=reverse)
938+
return unique_justseen(sequenced, key=key)
939939

940940
def sliding_window(iterable, n):
941941
"Collect data into overlapping fixed-length chunks or blocks."

Doc/whatsnew/3.15.rst

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,6 +1108,10 @@ tarfile
11081108
timeit
11091109
------
11101110

1111+
* The output of the :mod:`timeit` command-line interface is colored by default.
1112+
This can be controlled with
1113+
:ref:`environment variables <using-on-controlling-color>`.
1114+
(Contributed by Hugo van Kemenade in :gh:`146609`.)
11111115
* The command-line interface now colorizes error tracebacks
11121116
by default. This can be controlled with
11131117
:ref:`environment variables <using-on-controlling-color>`.
@@ -1305,6 +1309,25 @@ warnings
13051309
(Contributed by Serhiy Storchaka in :gh:`135801`.)
13061310

13071311

1312+
wave
1313+
----
1314+
1315+
* Added support for IEEE floating-point WAVE audio
1316+
(``WAVE_FORMAT_IEEE_FLOAT``) in :mod:`wave`.
1317+
1318+
* Added :meth:`wave.Wave_read.getformat`, :meth:`wave.Wave_write.getformat`,
1319+
and :meth:`wave.Wave_write.setformat` for explicit frame format handling.
1320+
1321+
* :meth:`wave.Wave_write.setparams` accepts both 7-item tuples including
1322+
``format`` and 6-item tuples for backwards compatibility (defaulting to
1323+
``WAVE_FORMAT_PCM``).
1324+
1325+
* ``WAVE_FORMAT_IEEE_FLOAT`` output now includes a ``fact`` chunk,
1326+
as required for non-PCM WAVE formats.
1327+
1328+
(Contributed by Lionel Koenig and Michiel W. Beijen in :gh:`60729`.)
1329+
1330+
13081331
xml.parsers.expat
13091332
-----------------
13101333

@@ -1574,21 +1597,6 @@ typing
15741597
wave
15751598
----
15761599

1577-
* Added support for IEEE floating-point WAVE audio
1578-
(``WAVE_FORMAT_IEEE_FLOAT``) in :mod:`wave`.
1579-
1580-
* Added :meth:`wave.Wave_read.getformat`, :meth:`wave.Wave_write.getformat`,
1581-
and :meth:`wave.Wave_write.setformat` for explicit frame format handling.
1582-
1583-
* :meth:`wave.Wave_write.setparams` accepts both 7-item tuples including
1584-
``format`` and 6-item tuples for backwards compatibility (defaulting to
1585-
``WAVE_FORMAT_PCM``).
1586-
1587-
* ``WAVE_FORMAT_IEEE_FLOAT`` output now includes a ``fact`` chunk,
1588-
as required for non-PCM WAVE formats.
1589-
1590-
(Contributed by Lionel Koenig and Michiel W. Beijen in :gh:`60729`.)
1591-
15921600
* Removed the ``getmark()``, ``setmark()`` and ``getmarkers()`` methods
15931601
of the :class:`~wave.Wave_read` and :class:`~wave.Wave_write` classes,
15941602
which were deprecated since Python 3.13.

Include/internal/pycore_opcode_metadata.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_uop_ids.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_uop_metadata.h

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lib/_colorize.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,18 @@ class Syntax(ThemeSection):
362362
reset: str = ANSIColors.RESET
363363

364364

365+
@dataclass(frozen=True, kw_only=True)
366+
class Timeit(ThemeSection):
367+
timing: str = ANSIColors.CYAN
368+
best: str = ANSIColors.BOLD_GREEN
369+
per_loop: str = ANSIColors.GREEN
370+
punctuation: str = ANSIColors.GREY
371+
warning: str = ANSIColors.YELLOW
372+
warning_worst: str = ANSIColors.MAGENTA
373+
warning_best: str = ANSIColors.GREEN
374+
reset: str = ANSIColors.RESET
375+
376+
365377
@dataclass(frozen=True, kw_only=True)
366378
class Traceback(ThemeSection):
367379
type: str = ANSIColors.BOLD_MAGENTA
@@ -397,6 +409,7 @@ class Theme:
397409
http_server: HttpServer = field(default_factory=HttpServer)
398410
live_profiler: LiveProfiler = field(default_factory=LiveProfiler)
399411
syntax: Syntax = field(default_factory=Syntax)
412+
timeit: Timeit = field(default_factory=Timeit)
400413
traceback: Traceback = field(default_factory=Traceback)
401414
unittest: Unittest = field(default_factory=Unittest)
402415

@@ -409,6 +422,7 @@ def copy_with(
409422
http_server: HttpServer | None = None,
410423
live_profiler: LiveProfiler | None = None,
411424
syntax: Syntax | None = None,
425+
timeit: Timeit | None = None,
412426
traceback: Traceback | None = None,
413427
unittest: Unittest | None = None,
414428
) -> Self:
@@ -424,6 +438,7 @@ def copy_with(
424438
http_server=http_server or self.http_server,
425439
live_profiler=live_profiler or self.live_profiler,
426440
syntax=syntax or self.syntax,
441+
timeit=timeit or self.timeit,
427442
traceback=traceback or self.traceback,
428443
unittest=unittest or self.unittest,
429444
)
@@ -443,6 +458,7 @@ def no_colors(cls) -> Self:
443458
http_server=HttpServer.no_colors(),
444459
live_profiler=LiveProfiler.no_colors(),
445460
syntax=Syntax.no_colors(),
461+
timeit=Timeit.no_colors(),
446462
traceback=Traceback.no_colors(),
447463
unittest=Unittest.no_colors(),
448464
)

0 commit comments

Comments
 (0)