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
3 changes: 3 additions & 0 deletions Doc/bugs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ It can be sometimes faster to fix bugs yourself and contribute patches to
Python as it streamlines the process and involves fewer people. Learn how to
:ref:`contribute <contributing-to-python>`.


.. _reporting-documentation-bugs:

Documentation bugs
==================

Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ Properly implementing :c:member:`~PyTypeObject.tp_repr` for container types requ
special recursion handling. In addition to protecting the stack,
:c:member:`~PyTypeObject.tp_repr` also needs to track objects to prevent cycles. The
following two functions facilitate this functionality. Effectively,
these are the C equivalent to :func:`reprlib.recursive_repr`.
these are the C equivalent to :deco:`reprlib.recursive_repr`.

.. c:function:: int Py_ReprEnter(PyObject *object)

Expand Down
42 changes: 21 additions & 21 deletions Doc/c-api/interp-lifecycle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.

Set by the :option:`-b` option.

.. deprecated-removed:: 3.12 3.15
.. deprecated-removed:: 3.12 3.16


.. c:var:: int Py_DebugFlag
Expand All @@ -119,7 +119,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
Set by the :option:`-d` option and the :envvar:`PYTHONDEBUG` environment
variable.

.. deprecated-removed:: 3.12 3.15
.. deprecated-removed:: 3.12 3.16


.. c:var:: int Py_DontWriteBytecodeFlag
Expand All @@ -134,7 +134,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
Set by the :option:`-B` option and the :envvar:`PYTHONDONTWRITEBYTECODE`
environment variable.

.. deprecated-removed:: 3.12 3.15
.. deprecated-removed:: 3.12 3.16


.. c:var:: int Py_FrozenFlag
Expand All @@ -145,7 +145,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.

Private flag used by ``_freeze_module`` and ``frozenmain`` programs.

.. deprecated-removed:: 3.12 3.15
.. deprecated-removed:: 3.12 3.16


.. c:var:: int Py_HashRandomizationFlag
Expand All @@ -161,7 +161,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
If the flag is non-zero, read the :envvar:`PYTHONHASHSEED` environment
variable to initialize the secret hash seed.

.. deprecated-removed:: 3.12 3.15
.. deprecated-removed:: 3.12 3.16


.. c:var:: int Py_IgnoreEnvironmentFlag
Expand All @@ -175,7 +175,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.

Set by the :option:`-E` and :option:`-I` options.

.. deprecated-removed:: 3.12 3.15
.. deprecated-removed:: 3.12 3.16


.. c:var:: int Py_InspectFlag
Expand All @@ -191,7 +191,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
Set by the :option:`-i` option and the :envvar:`PYTHONINSPECT` environment
variable.

.. deprecated-removed:: 3.12 3.15
.. deprecated-removed:: 3.12 3.16


.. c:var:: int Py_InteractiveFlag
Expand All @@ -202,7 +202,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.

Set by the :option:`-i` option.

.. deprecated-removed:: 3.12 3.15
.. deprecated-removed:: 3.12 3.16


.. c:var:: int Py_IsolatedFlag
Expand All @@ -218,7 +218,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.

.. versionadded:: 3.4

.. deprecated-removed:: 3.12 3.15
.. deprecated-removed:: 3.12 3.16


.. c:var:: int Py_LegacyWindowsFSEncodingFlag
Expand All @@ -238,7 +238,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.

.. availability:: Windows.

.. deprecated-removed:: 3.12 3.15
.. deprecated-removed:: 3.12 3.16


.. c:var:: int Py_LegacyWindowsStdioFlag
Expand All @@ -257,7 +257,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.

.. availability:: Windows.

.. deprecated-removed:: 3.12 3.15
.. deprecated-removed:: 3.12 3.16


.. c:var:: int Py_NoSiteFlag
Expand All @@ -273,7 +273,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.

Set by the :option:`-S` option.

.. deprecated-removed:: 3.12 3.15
.. deprecated-removed:: 3.12 3.16


.. c:var:: int Py_NoUserSiteDirectory
Expand All @@ -288,7 +288,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
Set by the :option:`-s` and :option:`-I` options, and the
:envvar:`PYTHONNOUSERSITE` environment variable.

.. deprecated-removed:: 3.12 3.15
.. deprecated-removed:: 3.12 3.16


.. c:var:: int Py_OptimizeFlag
Expand All @@ -300,7 +300,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
Set by the :option:`-O` option and the :envvar:`PYTHONOPTIMIZE` environment
variable.

.. deprecated-removed:: 3.12 3.15
.. deprecated-removed:: 3.12 3.16


.. c:var:: int Py_QuietFlag
Expand All @@ -315,7 +315,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.

.. versionadded:: 3.2

.. deprecated-removed:: 3.12 3.15
.. deprecated-removed:: 3.12 3.16


.. c:var:: int Py_UnbufferedStdioFlag
Expand All @@ -329,7 +329,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
Set by the :option:`-u` option and the :envvar:`PYTHONUNBUFFERED`
environment variable.

.. deprecated-removed:: 3.12 3.15
.. deprecated-removed:: 3.12 3.16


.. c:var:: int Py_VerboseFlag
Expand All @@ -346,7 +346,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
Set by the :option:`-v` option and the :envvar:`PYTHONVERBOSE` environment
variable.

.. deprecated-removed:: 3.12 3.15
.. deprecated-removed:: 3.12 3.16


Initializing and finalizing the interpreter
Expand Down Expand Up @@ -804,7 +804,7 @@ Process-wide parameters
Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a
:c:expr:`wchar_t*` string.

.. deprecated-removed:: 3.11 3.15
.. deprecated-removed:: 3.11 3.16


.. c:function:: const char* Py_GetVersion()
Expand Down Expand Up @@ -929,7 +929,7 @@ Process-wide parameters

.. versionadded:: 3.1.3

.. deprecated-removed:: 3.11 3.15
.. deprecated-removed:: 3.11 3.16


.. c:function:: void PySys_SetArgv(int argc, wchar_t **argv)
Expand All @@ -950,7 +950,7 @@ Process-wide parameters

.. versionchanged:: 3.4 The *updatepath* value depends on :option:`-I`.

.. deprecated-removed:: 3.11 3.15
.. deprecated-removed:: 3.11 3.16


.. c:function:: void Py_SetPythonHome(const wchar_t *home)
Expand All @@ -971,4 +971,4 @@ Process-wide parameters
Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a
:c:expr:`wchar_t*` string.

.. deprecated-removed:: 3.11 3.15
.. deprecated-removed:: 3.11 3.16
40 changes: 40 additions & 0 deletions Doc/c-api/perfmaps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,43 @@ Note that holding an :term:`attached thread state` is not required for these API
This is called by the runtime itself during interpreter shut-down. In
general, there shouldn't be a reason to explicitly call this, except to
handle specific scenarios such as forking.

.. c:function:: int PyUnstable_CopyPerfMapFile(const char *parent_filename)

Open the ``/tmp/perf-$pid.map`` file and append the content of *parent_filename*
to it.

This function is available on all platforms but only generates output on platforms
that support perf maps (currently only Linux). On other platforms, it does nothing.

.. versionadded:: 3.13

.. c:function:: int PyUnstable_PerfTrampoline_CompileCode(PyCodeObject *code)

Compile the given code object using the current perf trampoline.

The "current" trampoline is the one set by the runtime or the most recent
:c:func:`PyUnstable_PerfTrampoline_SetPersistAfterFork` call.

If no trampoline is set, falls back to normal compilation (no perf map entry).

:param code: The code object to compile.
:return: 0 on success, -1 on failure.

.. versionadded:: 3.13

.. c:function:: int PyUnstable_PerfTrampoline_SetPersistAfterFork(int enable)

Set whether the perf trampoline should persist after a fork.

* If ``enable`` is true (non-zero): perf map file remains open/valid post-fork.
Child process inherits all existing perf map entries.
* If ``enable`` is false (zero): perf map closes post-fork.
Child process gets empty perf map.

Default: false (clears on fork).

:param enable: 1 to enable, 0 to disable.
:return: 0 on success, -1 on failure.

.. versionadded:: 3.13
6 changes: 3 additions & 3 deletions Doc/c-api/structures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,8 @@ method.

The method will be passed the type object as the first parameter rather
than an instance of the type. This is used to create *class methods*,
similar to what is created when using the :func:`classmethod` built-in
function.
similar to what is created when using the :deco:`classmethod` built-in
decorator.


.. c:macro:: METH_STATIC
Expand All @@ -464,7 +464,7 @@ method.

The method will be passed ``NULL`` as the first parameter rather than an
instance of the type. This is used to create *static methods*, similar to
what is created when using the :func:`staticmethod` built-in function.
what is created when using the :deco:`staticmethod` built-in decorator.

One other constant controls whether a method is loaded in place of another
definition with the same method name.
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/unicode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1953,7 +1953,7 @@ The following API is deprecated.
whether you selected a "narrow" or "wide" Unicode version of Python at
build time.

.. deprecated-removed:: 3.13 3.15
.. deprecated-removed:: 3.13 3.16


.. c:function:: int PyUnicode_READY(PyObject *unicode)
Expand Down
12 changes: 7 additions & 5 deletions Doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@

import os
import sys
from importlib import import_module
from importlib.util import find_spec

# Make our custom extensions available to Sphinx
sys.path.append(os.path.abspath('tools/extensions'))
sys.path.append(os.path.abspath('includes'))

# Python specific content from Doc/Tools/extensions/pyspecific.py
from pyspecific import SOURCE_URI
from patchlevel import get_header_version_info, get_version_info

# General configuration
# ---------------------
Expand Down Expand Up @@ -78,7 +76,7 @@
# We look for the Include/patchlevel.h file in the current Python source tree
# and replace the values accordingly.
# See Doc/tools/extensions/patchlevel.py
version, release = import_module('patchlevel').get_version_info()
version, release = get_version_info()

rst_epilog = f"""
.. |python_version_literal| replace:: ``Python {version}``
Expand Down Expand Up @@ -555,16 +553,20 @@
r'https://unix.org/version2/whatsnew/lp64_wp.html',
]


# Options for sphinx.ext.extlinks
# -------------------------------

v = get_header_version_info()
branch = "main" if v.releaselevel == "alpha" else f"{v.major}.{v.minor}"

# This config is a dictionary of external sites,
# mapping unique short aliases to a base URL and a prefix.
# https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html
extlinks = {
"oss-fuzz": ("https://issues.oss-fuzz.com/issues/%s", "#%s"),
"pypi": ("https://pypi.org/project/%s/", "%s"),
"source": (SOURCE_URI, "%s"),
"source": (f"https://github.com/python/cpython/tree/{branch}/%s", "%s"),
}
extlinks_detect_hardcoded_links = True

Expand Down
2 changes: 1 addition & 1 deletion Doc/data/stable_abi.dat

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

Loading
Loading