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
2 changes: 1 addition & 1 deletion Doc/bugs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ stability. In order to maintain this reputation, the developers would like to
know of any deficiencies you find in Python.

It can be sometimes faster to fix bugs yourself and contribute patches to
Python as it streamlines the process and involves less people. Learn how to
Python as it streamlines the process and involves fewer people. Learn how to
:ref:`contribute <contributing-to-python>`.

Documentation bugs
Expand Down
4 changes: 2 additions & 2 deletions Doc/c-api/float.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Floating-Point Objects

.. c:macro:: Py_INFINITY

This macro expands a to constant expression of type :c:expr:`double`, that
This macro expands to a constant expression of type :c:expr:`double`, that
represents the positive infinity.

It is equivalent to the :c:macro:`!INFINITY` macro from the C11 standard
Expand All @@ -92,7 +92,7 @@ Floating-Point Objects

.. c:macro:: Py_NAN

This macro expands a to constant expression of type :c:expr:`double`, that
This macro expands to a constant expression of type :c:expr:`double`, that
represents a quiet not-a-number (qNaN) value.

On most platforms, this is equivalent to the :c:macro:`!NAN` macro from
Expand Down
8 changes: 4 additions & 4 deletions Doc/c-api/init.rst
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ Initializing and finalizing the interpreter

Note that Python will do a best effort at freeing all memory allocated by the Python
interpreter. Therefore, any C-Extension should make sure to correctly clean up all
of the preveiously allocated PyObjects before using them in subsequent calls to
of the previously allocated PyObjects before using them in subsequent calls to
:c:func:`Py_Initialize`. Otherwise it could introduce vulnerabilities and incorrect
behavior.

Expand Down Expand Up @@ -1407,7 +1407,7 @@ All of the following functions must be called after :c:func:`Py_Initialize`.

Get the current interpreter.

Issue a fatal error if there no :term:`attached thread state`.
Issue a fatal error if there is no :term:`attached thread state`.
It cannot return NULL.

.. versionadded:: 3.9
Expand Down Expand Up @@ -1979,7 +1979,7 @@ Python-level trace functions in previous versions.
*what* when after any bytecode is processed after which the exception becomes
set within the frame being executed. The effect of this is that as exception
propagation causes the Python stack to unwind, the callback is called upon
return to each frame as the exception propagates. Only trace functions receives
return to each frame as the exception propagates. Only trace functions receive
these events; they are not needed by the profiler.


Expand Down Expand Up @@ -2119,7 +2119,7 @@ Reference tracing
the tracer function is called. Return ``0`` on success. Set an exception and
return ``-1`` on error.

Not that tracer functions **must not** create Python objects inside or
Note that tracer functions **must not** create Python objects inside or
otherwise the call will be re-entrant. The tracer also **must not** clear
any existing exception or set an exception. A :term:`thread state` will be active
every time the tracer function is called.
Expand Down
6 changes: 3 additions & 3 deletions Doc/c-api/init_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -544,9 +544,9 @@ Configuration Options

Visibility:

* Public: Can by get by :c:func:`PyConfig_Get` and set by
* Public: Can be retrieved by :c:func:`PyConfig_Get` and set by
:c:func:`PyConfig_Set`.
* Read-only: Can by get by :c:func:`PyConfig_Get`, but cannot be set by
* Read-only: Can be retrieved by :c:func:`PyConfig_Get`, but cannot be set by
:c:func:`PyConfig_Set`.


Expand Down Expand Up @@ -1153,7 +1153,7 @@ PyConfig

Most ``PyConfig`` methods :ref:`preinitialize Python <c-preinit>` if needed.
In that case, the Python preinitialization configuration
(:c:type:`PyPreConfig`) in based on the :c:type:`PyConfig`. If configuration
(:c:type:`PyPreConfig`) is based on the :c:type:`PyConfig`. If configuration
fields which are in common with :c:type:`PyPreConfig` are tuned, they must
be set before calling a :c:type:`PyConfig` method:

Expand Down
4 changes: 2 additions & 2 deletions Doc/c-api/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ Docstring macros
General utility macros
----------------------

The following macros common tasks not specific to Python.
The following macros are for common tasks not specific to Python.

.. c:macro:: Py_UNUSED(arg)
Expand Down Expand Up @@ -317,7 +317,7 @@ Assertion utilities
In debug mode, and on unsupported compilers, the macro expands to a call to
:c:func:`Py_FatalError`.

A use for ``Py_UNREACHABLE()`` is following a call a function that
A use for ``Py_UNREACHABLE()`` is following a call to a function that
never returns but that is not declared ``_Noreturn``.

If a code path is very unlikely code but can be reached under exceptional
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ remove it.
.. versionchanged:: 3.9

:c:member:`m_traverse`, :c:member:`m_clear` and :c:member:`m_free`
functions are longer called before the module state is allocated.
functions are no longer called before the module state is allocated.


.. _moduledef-dynamic:
Expand Down
17 changes: 17 additions & 0 deletions Doc/c-api/object.rst
Original file line number Diff line number Diff line change
Expand Up @@ -801,3 +801,20 @@ Object Protocol
cannot fail.

.. versionadded:: 3.14

.. c:function:: int PyUnstable_SetImmortal(PyObject *op)

Marks the object *op* :term:`immortal`. The argument should be uniquely referenced by
the calling thread. This is intended to be used for reducing reference counting contention
in the :term:`free-threaded build` for objects which are shared across threads.

This is a one-way process: objects can only be made immortal; they cannot be
made mortal once again. Immortal objects do not participate in reference counting
and will never be garbage collected. If the object is GC-tracked, it is untracked.

This function is intended to be used soon after *op* is created, by the code that
creates it, such as in the object's :c:member:`~PyTypeObject.tp_new` slot.
Returns 1 if the object was made immortal and returns 0 if it was not.
This function cannot fail.

.. versionadded:: next
2 changes: 1 addition & 1 deletion Doc/c-api/structures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ There are these calling conventions:


These two constants are not used to indicate the calling convention but the
binding when use with methods of classes. These may not be used for functions
binding when used with methods of classes. These may not be used for functions
defined for modules. At most one of these flags may be set for any given
method.

Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/veryhigh.rst
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ the same library that the Python runtime is using.
objects *globals* and *locals* with the compiler flags specified by
*flags*. *globals* must be a dictionary; *locals* can be any object
that implements the mapping protocol. The parameter *start* specifies
the start symbol and must one of the :ref:`available start symbols <start-symbols>`.
the start symbol and must be one of the :ref:`available start symbols <start-symbols>`.

Returns the result of executing the code as a Python object, or ``NULL`` if an
exception was raised.
Expand Down
2 changes: 1 addition & 1 deletion Doc/deprecations/pending-removal-in-3.15.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Pending removal in Python 3.15

* :func:`~threading.RLock` will take no arguments in Python 3.15.
Passing any arguments has been deprecated since Python 3.14,
as the Python version does not permit any arguments,
as the Python version does not permit any arguments,
but the C version allows any number of positional or keyword arguments,
ignoring every argument.

Expand Down
22 changes: 21 additions & 1 deletion Doc/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,16 @@ Glossary
to locks exist such as queues, producer/consumer patterns, and
thread-local state. See also :term:`deadlock`, and :term:`reentrant`.

lock-free
An operation that does not acquire any :term:`lock` and uses atomic CPU
instructions to ensure correctness. Lock-free operations can execute
concurrently without blocking each other and cannot be blocked by
operations that hold locks. In :term:`free-threaded <free threading>`
Python, built-in types like :class:`dict` and :class:`list` provide
lock-free read operations, which means other threads may observe
intermediate states during multi-step modifications even when those
modifications hold the :term:`per-object lock`.

loader
An object that loads a module.
It must define the :meth:`!exec_module` and :meth:`!create_module` methods
Expand Down Expand Up @@ -1217,6 +1227,16 @@ Glossary
<faq-argument-vs-parameter>`, the :class:`inspect.Parameter` class, the
:ref:`function` section, and :pep:`362`.

per-object lock
A :term:`lock` associated with an individual object instance rather than
a global lock shared across all objects. In :term:`free-threaded
<free threading>` Python, built-in types like :class:`dict` and
:class:`list` use per-object locks to allow concurrent operations on
different objects while serializing operations on the same object.
Operations that hold the per-object lock prevent other locking operations
on the same object from proceeding, but do not block :term:`lock-free`
operations.

path entry
A single location on the :term:`import path` which the :term:`path
based finder` consults to find modules for importing.
Expand Down Expand Up @@ -1339,7 +1359,7 @@ Glossary
'email.mime.text'

race condition
A condition of a program where the its behavior
A condition of a program where the behavior
depends on the relative timing or ordering of events, particularly in
multi-threaded programs. Race conditions can lead to
:term:`non-deterministic` behavior and bugs that are difficult to
Expand Down
6 changes: 3 additions & 3 deletions Doc/library/base64.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ POST request.

For more information about the strict base64 check, see :func:`binascii.a2b_base64`

.. versionchanged:: next
.. versionchanged:: 3.15
Added the *ignorechars* parameter.

.. deprecated:: next
.. deprecated:: 3.15
Accepting the ``+`` and ``/`` characters with an alternative alphabet
is now deprecated.

Expand Down Expand Up @@ -142,7 +142,7 @@ POST request.
``/`` in the standard Base64 alphabet, and return the decoded
:class:`bytes`.

.. deprecated:: next
.. deprecated:: 3.15
Accepting the ``+`` and ``/`` characters is now deprecated.


Expand Down
14 changes: 7 additions & 7 deletions Doc/library/binascii.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ The :mod:`!binascii` module defines the following functions:
.. versionchanged:: 3.11
Added the *strict_mode* parameter.

.. versionchanged:: next
.. versionchanged:: 3.15
Added the *ignorechars* parameter.


Expand Down Expand Up @@ -122,7 +122,7 @@ The :mod:`!binascii` module defines the following functions:

Invalid Ascii85 data will raise :exc:`binascii.Error`.

.. versionadded:: next
.. versionadded:: 3.15


.. function:: b2a_ascii85(data, /, *, foldspaces=False, wrapcol=0, pad=False, adobe=False)
Expand All @@ -145,7 +145,7 @@ The :mod:`!binascii` module defines the following functions:
*adobe* controls whether the encoded byte sequence is framed with ``<~``
and ``~>``, which is used by the Adobe implementation.

.. versionadded:: next
.. versionadded:: 3.15


.. function:: a2b_base85(string, /)
Expand All @@ -160,7 +160,7 @@ The :mod:`!binascii` module defines the following functions:

Invalid Base85 data will raise :exc:`binascii.Error`.

.. versionadded:: next
.. versionadded:: 3.15


.. function:: b2a_base85(data, /, *, pad=False)
Expand All @@ -171,7 +171,7 @@ The :mod:`!binascii` module defines the following functions:
If *pad* is true, the input is padded with ``b'\0'`` so its length is a
multiple of 4 bytes before encoding.

.. versionadded:: next
.. versionadded:: 3.15


.. function:: a2b_z85(string, /)
Expand All @@ -188,7 +188,7 @@ The :mod:`!binascii` module defines the following functions:

Invalid Z85 data will raise :exc:`binascii.Error`.

.. versionadded:: next
.. versionadded:: 3.15


.. function:: b2a_z85(data, /, *, pad=False)
Expand All @@ -201,7 +201,7 @@ The :mod:`!binascii` module defines the following functions:

See `Z85 specification <https://rfc.zeromq.org/spec/32/>`_ for more information.

.. versionadded:: next
.. versionadded:: 3.15


.. function:: a2b_qp(data, header=False)
Expand Down
18 changes: 9 additions & 9 deletions Doc/library/codecs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1551,8 +1551,8 @@ mapping. It is not supported by :meth:`str.encode` (which only produces
Restoration of the ``rot13`` alias.


:mod:`encodings` --- Encodings package
--------------------------------------
:mod:`!encodings` --- Encodings package
---------------------------------------

.. module:: encodings
:synopsis: Encodings package
Expand Down Expand Up @@ -1611,8 +1611,8 @@ This module implements the following exception:
Raised when a codec is invalid or incompatible.


:mod:`encodings.idna` --- Internationalized Domain Names in Applications
------------------------------------------------------------------------
:mod:`!encodings.idna` --- Internationalized Domain Names in Applications
-------------------------------------------------------------------------

.. module:: encodings.idna
:synopsis: Internationalized Domain Names implementation
Expand Down Expand Up @@ -1654,7 +1654,7 @@ When receiving host names from the wire (such as in reverse name lookup), no
automatic conversion to Unicode is performed: applications wishing to present
such host names to the user should decode them to Unicode.

The module :mod:`encodings.idna` also implements the nameprep procedure, which
The module :mod:`!encodings.idna` also implements the nameprep procedure, which
performs certain normalizations on host names, to achieve case-insensitivity of
international domain names, and to unify similar characters. The nameprep
functions can be used directly if desired.
Expand All @@ -1677,8 +1677,8 @@ functions can be used directly if desired.
Convert a label to Unicode, as specified in :rfc:`3490`.


:mod:`encodings.mbcs` --- Windows ANSI codepage
-----------------------------------------------
:mod:`!encodings.mbcs` --- Windows ANSI codepage
------------------------------------------------

.. module:: encodings.mbcs
:synopsis: Windows ANSI codepage
Expand All @@ -1695,8 +1695,8 @@ This module implements the ANSI codepage (CP_ACP).
Support any error handler.


:mod:`encodings.utf_8_sig` --- UTF-8 codec with BOM signature
-------------------------------------------------------------
:mod:`!encodings.utf_8_sig` --- UTF-8 codec with BOM signature
--------------------------------------------------------------

.. module:: encodings.utf_8_sig
:synopsis: UTF-8 codec with BOM signature
Expand Down
8 changes: 4 additions & 4 deletions Doc/library/contextlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ Functions and classes provided:
Raises :exc:`TypeError` instead of :exc:`AttributeError` if *cm*
is not a context manager.

.. versionchanged:: next
.. versionchanged:: 3.15
Added support for arbitrary descriptors :meth:`!__enter__` and
:meth:`!__exit__`.

Expand All @@ -586,7 +586,7 @@ Functions and classes provided:
The passed in object is returned from the function, allowing this
method to be used as a function decorator.

.. versionchanged:: next
.. versionchanged:: 3.15
Added support for arbitrary descriptors :meth:`!__exit__`.

.. method:: callback(callback, /, *args, **kwds)
Expand Down Expand Up @@ -646,15 +646,15 @@ Functions and classes provided:
Raises :exc:`TypeError` instead of :exc:`AttributeError` if *cm*
is not an asynchronous context manager.

.. versionchanged:: next
.. versionchanged:: 3.15
Added support for arbitrary descriptors :meth:`!__aenter__` and :meth:`!__aexit__`.

.. method:: push_async_exit(exit)

Similar to :meth:`ExitStack.push` but expects either an asynchronous context manager
or a coroutine function.

.. versionchanged:: next
.. versionchanged:: 3.15
Added support for arbitrary descriptors :meth:`!__aexit__`.

.. method:: push_async_callback(callback, /, *args, **kwds)
Expand Down
Loading
Loading