Skip to content

Complete doc of pending C API removals in Python 3.15 #129032

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 19, 2025
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
40 changes: 20 additions & 20 deletions Doc/c-api/init.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.

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

.. deprecated-removed:: 3.12 3.14
.. deprecated-removed:: 3.12 3.15

.. c:var:: int Py_DebugFlag

Expand All @@ -123,7 +123,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.14
.. deprecated-removed:: 3.12 3.15

.. c:var:: int Py_DontWriteBytecodeFlag

Expand All @@ -137,7 +137,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.14
.. deprecated-removed:: 3.12 3.15

.. c:var:: int Py_FrozenFlag

Expand All @@ -150,7 +150,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.14
.. deprecated-removed:: 3.12 3.15

.. c:var:: int Py_HashRandomizationFlag

Expand All @@ -165,7 +165,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.14
.. deprecated-removed:: 3.12 3.15

.. c:var:: int Py_IgnoreEnvironmentFlag

Expand All @@ -178,7 +178,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.14
.. deprecated-removed:: 3.12 3.15

.. c:var:: int Py_InspectFlag

Expand All @@ -193,7 +193,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.14
.. deprecated-removed:: 3.12 3.15

.. c:var:: int Py_InteractiveFlag

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.14
.. deprecated-removed:: 3.12 3.15

.. c:var:: int Py_LegacyWindowsFSEncodingFlag

Expand All @@ -237,7 +237,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.

.. availability:: Windows.

.. deprecated-removed:: 3.12 3.14
.. deprecated-removed:: 3.12 3.15

.. c:var:: int Py_LegacyWindowsStdioFlag

Expand All @@ -255,7 +255,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.

.. availability:: Windows.

.. deprecated-removed:: 3.12 3.14
.. deprecated-removed:: 3.12 3.15

.. c:var:: int Py_NoSiteFlag

Expand All @@ -270,7 +270,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.

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

.. deprecated-removed:: 3.12 3.14
.. deprecated-removed:: 3.12 3.15

.. c:var:: int Py_NoUserSiteDirectory

Expand All @@ -284,7 +284,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.14
.. deprecated-removed:: 3.12 3.15

.. c:var:: int Py_OptimizeFlag

Expand All @@ -295,7 +295,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.14
.. deprecated-removed:: 3.12 3.15

.. c:var:: int Py_QuietFlag

Expand All @@ -309,7 +309,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.

.. versionadded:: 3.2

.. deprecated-removed:: 3.12 3.14
.. deprecated-removed:: 3.12 3.15

.. c:var:: int Py_UnbufferedStdioFlag

Expand All @@ -322,7 +322,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.14
.. deprecated-removed:: 3.12 3.15

.. c:var:: int Py_VerboseFlag

Expand All @@ -338,7 +338,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.14
.. deprecated-removed:: 3.12 3.15


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

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


.. c:function:: wchar_t* Py_GetProgramName()
Expand Down Expand Up @@ -868,7 +868,7 @@ Process-wide parameters
.. XXX impl. doesn't seem consistent in allowing ``0``/``NULL`` for the params;
check w/ Guido.

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


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

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

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


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

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


.. c:function:: wchar_t* Py_GetPythonHome()
Expand Down
8 changes: 6 additions & 2 deletions Doc/deprecations/c-api-pending-removal-in-3.15.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ Pending removal in Python 3.15
* The :c:func:`PyImport_ImportModuleNoBlock`:
Use :c:func:`PyImport_ImportModule` instead.
* :c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`:
Use :c:func:`PyWeakref_GetRef` instead.
Use :c:func:`PyWeakref_GetRef` instead. The `pythoncapi-compat project
<https://github.com/python/pythoncapi-compat/>`__ can be used to get
:c:func:`PyWeakref_GetRef` on Python 3.12 and older.
* :c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro:
Use :c:type:`wchar_t` instead.
* Python initialization functions:
Expand All @@ -23,9 +25,11 @@ Pending removal in Python 3.15
* :c:func:`Py_GetProgramName`:
Get :data:`sys.executable` instead.
* :c:func:`Py_GetPythonHome`:
Get :c:member:`PyConfig.home`
Get :c:func:`PyConfig_Get("home") <PyConfig_Get>`
or the :envvar:`PYTHONHOME` environment variable instead.

See also the :c:func:`PyConfig_Get` function.

* Functions to configure Python's initialization, deprecated in Python 3.11:

* :c:func:`!PySys_SetArgvEx()`:
Expand Down
Loading