Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions Doc/library/asyncio-eventloop.rst
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,9 @@ clocks to track time.
are called is undefined.

The optional positional *args* will be passed to the callback when
it is called. If you want the callback to be called with keyword
arguments use :func:`functools.partial`.
it is called. Use :func:`functools.partial`
:ref:`to pass keyword arguments <asyncio-pass-keywords>` to
*callback*.

An optional keyword-only *context* argument allows specifying a
custom :class:`contextvars.Context` for the *callback* to run in.
Expand Down Expand Up @@ -1034,8 +1035,8 @@ Watching file descriptors
.. method:: loop.add_writer(fd, callback, *args)

Start monitoring the *fd* file descriptor for write availability and
invoke *callback* with the specified arguments once *fd* is available for
writing.
invoke *callback* with the specified arguments *args* once *fd* is
available for writing.

Any preexisting callback registered for *fd* is cancelled and replaced by
*callback*.
Expand Down Expand Up @@ -1308,7 +1309,8 @@ Unix signals

.. method:: loop.add_signal_handler(signum, callback, *args)

Set *callback* as the handler for the *signum* signal.
Set *callback* as the handler for the *signum* signal,
passing *args* as positional arguments.

The callback will be invoked by *loop*, along with other queued callbacks
and runnable coroutines of that event loop. Unlike signal handlers
Expand Down Expand Up @@ -1343,7 +1345,8 @@ Executing code in thread or process pools

.. awaitablemethod:: loop.run_in_executor(executor, func, *args)

Arrange for *func* to be called in the specified executor.
Arrange for *func* to be called in the specified executor
passing *args* as positional arguments.

The *executor* argument should be an :class:`concurrent.futures.Executor`
instance. The default executor is used if *executor* is ``None``.
Expand Down
14 changes: 7 additions & 7 deletions Doc/library/profiling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Choosing a profiler

For most performance analysis, use the statistical profiler
(:mod:`profiling.sampling`). It has minimal overhead, works for both development
and production, and provides rich visualization options including flamegraphs,
and production, and provides rich visualization options including flame graphs,
heatmaps, GIL analysis, and more.

Use the deterministic profiler (:mod:`profiling.tracing`) when you need **exact
Expand All @@ -81,7 +81,7 @@ The following table summarizes the key differences:
+--------------------+------------------------------+------------------------------+
| **Accuracy** | Statistical estimate | Exact call counts |
+--------------------+------------------------------+------------------------------+
| **Output formats** | pstats, flamegraph, heatmap, | pstats |
| **Output formats** | pstats, flame graph, heatmap,| pstats |
| | gecko, collapsed | |
+--------------------+------------------------------+------------------------------+
| **Profiling modes**| Wall-clock, CPU, GIL | Wall-clock |
Expand All @@ -103,7 +103,7 @@ performance analysis tasks. Use it the same way you would use

One of the main strengths of the sampling profiler is its variety of output
formats. Beyond traditional pstats tables, it can generate interactive
flamegraphs that visualize call hierarchies, line-level source heatmaps that
flame graphs that visualize call hierarchies, line-level source heatmaps that
show exactly where time is spent in your code, and Firefox Profiler output for
timeline-based analysis.

Expand Down Expand Up @@ -157,7 +157,7 @@ command::
python -m profiling.sampling run -m mypackage.module

This runs the script under the profiler and prints a summary of where time was
spent. For an interactive flamegraph::
spent. For an interactive flame graph::

python -m profiling.sampling run --flamegraph script.py

Expand Down Expand Up @@ -197,7 +197,7 @@ Understanding profile output

Both profilers collect function-level statistics, though they present them in
different formats. The sampling profiler offers multiple visualizations
(flamegraphs, heatmaps, Firefox Profiler, pstats tables), while the
(flame graphs, heatmaps, Firefox Profiler, pstats tables), while the
deterministic profiler produces pstats-compatible output. Regardless of format,
the underlying concepts are the same.

Expand Down Expand Up @@ -226,7 +226,7 @@ Key profiling concepts:

**Caller/Callee relationships**
Which functions called a given function (callers) and which functions it
called (callees). Flamegraphs visualize this as nested rectangles; pstats
called (callees). Flame graphs visualize this as nested rectangles; pstats
can display it via the :meth:`~pstats.Stats.print_callers` and
:meth:`~pstats.Stats.print_callees` methods.

Expand All @@ -248,7 +248,7 @@ continue to work without modification in all future Python versions.
.. seealso::

:mod:`profiling.sampling`
Statistical sampling profiler with flamegraphs, heatmaps, and GIL analysis.
Statistical sampling profiler with flame graphs, heatmaps, and GIL analysis.
Recommended for most users.

:mod:`profiling.tracing`
Expand Down
89 changes: 50 additions & 39 deletions Doc/whatsnew/3.15.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Summary -- Release highlights
* :pep:`799`: :ref:`A dedicated profiling package for organizing Python
profiling tools <whatsnew315-profiling-package>`
* :pep:`799`: :ref:`Tachyon: High frequency statistical sampling profiler
profiling tools <whatsnew315-sampling-profiler>`
<whatsnew315-sampling-profiler>`
* :pep:`798`: :ref:`Unpacking in Comprehensions
<whatsnew315-unpacking-in-comprehensions>`
* :pep:`686`: :ref:`Python now uses UTF-8 as the default encoding
Expand Down Expand Up @@ -161,13 +161,13 @@ Key features include:
timing with direct and cumulative samples. Best for detailed analysis and integration with
existing Python profiling tools.
* ``--collapsed``: Generates collapsed stack traces (one line per stack). This format is
specifically designed for creating flamegraphs with external tools like Brendan Gregg's
specifically designed for creating flame graphs with external tools like Brendan Gregg's
FlameGraph scripts or speedscope.
* ``--flamegraph``: Generates a self-contained interactive HTML flamegraph using D3.js.
Opens directly in your browser for immediate visual analysis. Flamegraphs show the call
* ``--flamegraph``: Generates a self-contained interactive HTML flame graph using D3.js.
Opens directly in your browser for immediate visual analysis. Flame graphs show the call
hierarchy where width represents time spent, making it easy to spot bottlenecks at a glance.
* ``--gecko``: Generates Gecko Profiler format compatible with Firefox Profiler
(https://profiler.firefox.com). Upload the output to Firefox Profiler for advanced
* ``--gecko``: Generates Gecko Profiler format compatible with `Firefox Profiler
<https://profiler.firefox.com>`__. Upload the output to Firefox Profiler for advanced
timeline-based analysis with features like stack charts, markers, and network activity.
* ``--heatmap``: Generates an interactive HTML heatmap visualization with line-level sample
counts. Creates a directory with per-file heatmaps showing exactly where time is spent
Expand All @@ -189,6 +189,7 @@ available output formats, profiling modes, and configuration options.

(Contributed by Pablo Galindo and László Kiss Kollár in :gh:`135953` and :gh:`138122`.)


.. _whatsnew315-unpacking-in-comprehensions:

:pep:`798`: Unpacking in Comprehensions
Expand Down Expand Up @@ -229,6 +230,7 @@ agen() for x in a)``.

(Contributed by Adam Hartz in :gh:`143055`.)


.. _whatsnew315-improved-error-messages:

Improved error messages
Expand Down Expand Up @@ -447,6 +449,7 @@ Other language changes
making it a :term:`generic type`.
(Contributed by James Hilton-Balfe in :gh:`128335`.)


New modules
===========

Expand Down Expand Up @@ -476,6 +479,7 @@ argparse
inline code when color output is enabled.
(Contributed by Savannah Ostrowski in :gh:`142390`.)


base64
------

Expand All @@ -488,6 +492,7 @@ base64
* Added the *ignorechars* parameter in :func:`~base64.b64decode`.
(Contributed by Serhiy Storchaka in :gh:`144001`.)


binascii
--------

Expand Down Expand Up @@ -526,6 +531,7 @@ collections
between :class:`~collections.Counter` objects.
(Contributed by Raymond Hettinger in :gh:`138682`.)


collections.abc
---------------

Expand Down Expand Up @@ -581,7 +587,6 @@ dbm
(Contributed by Andrea Oliveri in :gh:`134004`.)



difflib
-------

Expand Down Expand Up @@ -667,8 +672,10 @@ math
mimetypes
---------

* Add ``application/dicom`` MIME type for ``.dcm`` extension. (Contributed by Benedikt Johannes in :gh:`144217`.)
* Add ``application/node`` MIME type for ``.cjs`` extension. (Contributed by John Franey in :gh:`140937`.)
* Add ``application/dicom`` MIME type for ``.dcm`` extension.
(Contributed by Benedikt Johannes in :gh:`144217`.)
* Add ``application/node`` MIME type for ``.cjs`` extension.
(Contributed by John Franey in :gh:`140937`.)
* Add ``application/toml``. (Contributed by Gil Forcada in :gh:`139959`.)
* Add ``image/jxl``. (Contributed by Foolbar in :gh:`144213`.)
* Rename ``application/x-texinfo`` to ``application/texinfo``.
Expand Down Expand Up @@ -748,16 +755,16 @@ sqlite3

* The :ref:`command-line interface <sqlite3-cli>` has several new features:

* SQL keyword completion on <tab>.
(Contributed by Long Tan in :gh:`133393`.)
* SQL keyword completion on <tab>.
(Contributed by Long Tan in :gh:`133393`.)

* Prompts, error messages, and help text are now colored.
This is enabled by default, see :ref:`using-on-controlling-color` for
details.
(Contributed by Stan Ulbrych and Łukasz Langa in :gh:`133461`.)
* Prompts, error messages, and help text are now colored.
This is enabled by default, see :ref:`using-on-controlling-color` for
details.
(Contributed by Stan Ulbrych and Łukasz Langa in :gh:`133461`.)

* Table, index, trigger, view, column, function, and schema completion on <tab>.
(Contributed by Long Tan in :gh:`136101`.)
* Table, index, trigger, view, column, function, and schema completion on <tab>.
(Contributed by Long Tan in :gh:`136101`.)


ssl
Expand All @@ -769,21 +776,21 @@ ssl

* Added new methods for managing groups used for SSL key agreement

* :meth:`ssl.SSLContext.set_groups` sets the groups allowed for doing
key agreement, extending the previous
:meth:`ssl.SSLContext.set_ecdh_curve` method.
This new API provides the ability to list multiple groups and
supports fixed-field and post-quantum groups in addition to ECDH
curves. This method can also be used to control what key shares
are sent in the TLS handshake.
* :meth:`ssl.SSLSocket.group` returns the group selected for doing key
agreement on the current connection after the TLS handshake completes.
This call requires OpenSSL 3.2 or later.
* :meth:`ssl.SSLContext.get_groups` returns a list of all available key
agreement groups compatible with the minimum and maximum TLS versions
currently set in the context. This call requires OpenSSL 3.5 or later.

(Contributed by Ron Frederick in :gh:`136306`.)
* :meth:`ssl.SSLContext.set_groups` sets the groups allowed for doing
key agreement, extending the previous
:meth:`ssl.SSLContext.set_ecdh_curve` method.
This new API provides the ability to list multiple groups and
supports fixed-field and post-quantum groups in addition to ECDH
curves. This method can also be used to control what key shares
are sent in the TLS handshake.
* :meth:`ssl.SSLSocket.group` returns the group selected for doing key
agreement on the current connection after the TLS handshake completes.
This call requires OpenSSL 3.2 or later.
* :meth:`ssl.SSLContext.get_groups` returns a list of all available key
agreement groups compatible with the minimum and maximum TLS versions
currently set in the context. This call requires OpenSSL 3.5 or later.

(Contributed by Ron Frederick in :gh:`136306`.)

* Added a new method :meth:`ssl.SSLContext.set_ciphersuites` for setting TLS 1.3
ciphers. For TLS 1.2 or earlier, :meth:`ssl.SSLContext.set_ciphers` should
Expand All @@ -807,7 +814,8 @@ ssl
selected for the server to complete the TLS handshake on the current
connection. This call requires OpenSSL 3.5 or later.

(Contributed by Ron Frederick in :gh:`138252`.)
(Contributed by Ron Frederick in :gh:`138252`.)


subprocess
----------
Expand All @@ -824,6 +832,7 @@ subprocess
traditional busy loop (non-blocking call and short sleeps).
(Contributed by Giampaolo Rodola in :gh:`83069`).


symtable
--------

Expand Down Expand Up @@ -879,18 +888,18 @@ tkinter
arguments: *nolinestop* which allows the search to
continue across line boundaries;
and *strictlimits* which restricts the search to within the specified range.
(Contributed by Rihaan Meher in :gh:`130848`)
(Contributed by Rihaan Meher in :gh:`130848`.)

* A new method :meth:`!tkinter.Text.search_all` has been introduced.
This method allows for searching for all matches of a pattern
using Tcl's ``-all`` and ``-overlap`` options.
(Contributed by Rihaan Meher in :gh:`130848`)
(Contributed by Rihaan Meher in :gh:`130848`.)

* Added new methods :meth:`!pack_content`, :meth:`!place_content` and
:meth:`!grid_content` which use Tk commands with new names (introduced
in Tk 8.6) instead of :meth:`!*_slaves` methods which use Tk commands
with outdated names.
(Contributed by Serhiy Storchaka in :gh:`143754`)
(Contributed by Serhiy Storchaka in :gh:`143754`.)


.. _whatsnew315-tomllib-1-1-0:
Expand Down Expand Up @@ -1060,6 +1069,7 @@ Optimizations
(Contributed by Chris Eibl, Ken Jin, and Brandt Bucher in :gh:`143068`.
Special thanks to the MSVC team including Hulon Jenkins.)


base64 & binascii
-----------------

Expand All @@ -1072,6 +1082,7 @@ base64 & binascii
two orders of magnitude less memory.
(Contributed by James Seo and Serhiy Storchaka in :gh:`101178`.)


csv
---

Expand Down Expand Up @@ -1202,7 +1213,7 @@ importlib.resources

* Removed deprecated ``package`` parameter
from :func:`importlib.resources.files` function.
(Contributed by Semyon Moroz in :gh:`138044`)
(Contributed by Semyon Moroz in :gh:`138044`.)


pathlib
Expand Down Expand Up @@ -1453,7 +1464,7 @@ Changed C APIs

* If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` or :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF`
flag is set then :c:macro:`Py_TPFLAGS_HAVE_GC` must be set too.
(Contributed by Sergey Miryanov in :gh:`134786`)
(Contributed by Sergey Miryanov in :gh:`134786`.)


Porting to Python 3.15
Expand Down Expand Up @@ -1610,7 +1621,7 @@ Build changes
:manpage:`PR_SET_VMA_ANON_NAME <PR_SET_VMA(2const)>` (Linux 5.17 or newer).
Annotations are visible in ``/proc/<pid>/maps`` if the kernel supports the feature
and :option:`-X dev <-X>` is passed to the Python or Python is built in :ref:`debug mode <debug-build>`.
(Contributed by Donghee Na in :gh:`141770`)
(Contributed by Donghee Na in :gh:`141770`.)


Porting to Python 3.15
Expand Down
2 changes: 1 addition & 1 deletion Include/datetime.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ static PyDateTime_CAPI *PyDateTimeAPI = NULL;

static inline PyDateTime_CAPI *
_PyDateTime_IMPORT(void) {
PyDateTime_CAPI *val = _Py_atomic_load_ptr(&PyDateTimeAPI);
PyDateTime_CAPI *val = (PyDateTime_CAPI *)_Py_atomic_load_ptr(&PyDateTimeAPI);
if (val == NULL) {
PyDateTime_CAPI *capi = (PyDateTime_CAPI *)PyCapsule_Import(
PyDateTime_CAPSULE_NAME, 0);
Expand Down
4 changes: 2 additions & 2 deletions Include/internal/pycore_opcode_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Include/internal/pycore_uop_ids.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading