Skip to content

Commit 8a461c5

Browse files
committed
Docs: move deprecations into include files
1 parent c3677be commit 8a461c5

File tree

4 files changed

+99
-97
lines changed

4 files changed

+99
-97
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
Pending Removal in Python 3.14
2+
------------------------------
3+
4+
* Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable
5+
bases using the C API.
6+
7+
* Functions to configure the Python initialization, deprecated in Python 3.11:
8+
9+
* ``PySys_SetArgvEx()``: set :c:member:`PyConfig.argv` instead.
10+
* ``PySys_SetArgv()``: set :c:member:`PyConfig.argv` instead.
11+
* ``Py_SetProgramName()``: set :c:member:`PyConfig.program_name` instead.
12+
* ``Py_SetPythonHome()``: set :c:member:`PyConfig.home` instead.
13+
14+
The :c:func:`Py_InitializeFromConfig` API should be used with
15+
:c:type:`PyConfig` instead.
16+
17+
* Global configuration variables:
18+
19+
* :c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`
20+
* :c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`
21+
* :c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`
22+
* :c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`
23+
* :c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`
24+
* :c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`
25+
* :c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import`
26+
* :c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`
27+
* :c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`
28+
* :c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`
29+
* :c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`
30+
* :c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`
31+
* :c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`
32+
* :c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed`
33+
and :c:member:`PyConfig.hash_seed`
34+
* :c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`
35+
* :c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig.legacy_windows_fs_encoding`
36+
* :c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig.legacy_windows_stdio`
37+
* :c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig.filesystem_encoding`
38+
* :c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig.filesystem_encoding`
39+
* :c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig.filesystem_errors`
40+
* :c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:`Py_PreInitialize`)
41+
42+
The :c:func:`Py_InitializeFromConfig` API should be used with
43+
:c:type:`PyConfig` instead.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Pending Removal in Python 3.15
2+
------------------------------
3+
4+
* The bundled copy of ``libmpdecimal``.
5+
* :c:func:`PyImport_ImportModuleNoBlock`: use :c:func:`PyImport_ImportModule`.
6+
* :c:func:`PyWeakref_GET_OBJECT`: use :c:func:`PyWeakref_GetRef` instead.
7+
* :c:func:`PyWeakref_GetObject`: use :c:func:`PyWeakref_GetRef` instead.
8+
* :c:type:`!Py_UNICODE_WIDE` type: use :c:type:`wchar_t` instead.
9+
* :c:type:`Py_UNICODE` type: use :c:type:`wchar_t` instead.
10+
* Python initialization functions:
11+
12+
* :c:func:`PySys_ResetWarnOptions`: clear :data:`sys.warnoptions` and
13+
:data:`!warnings.filters` instead.
14+
* :c:func:`Py_GetExecPrefix`: get :data:`sys.exec_prefix` instead.
15+
* :c:func:`Py_GetPath`: get :data:`sys.path` instead.
16+
* :c:func:`Py_GetPrefix`: get :data:`sys.prefix` instead.
17+
* :c:func:`Py_GetProgramFullPath`: get :data:`sys.executable` instead.
18+
* :c:func:`Py_GetProgramName`: get :data:`sys.executable` instead.
19+
* :c:func:`Py_GetPythonHome`: get :c:member:`PyConfig.home` or
20+
:envvar:`PYTHONHOME` environment variable instead.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Pending Removal in Future Versions
2+
----------------------------------
3+
4+
The following APIs were deprecated in earlier Python versions and will be
5+
removed, although there is currently no date scheduled for their removal.
6+
7+
* :c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: no needed since Python 3.8.
8+
* :c:func:`PyErr_Fetch`: use :c:func:`PyErr_GetRaisedException`.
9+
* :c:func:`PyErr_NormalizeException`: use :c:func:`PyErr_GetRaisedException`.
10+
* :c:func:`PyErr_Restore`: use :c:func:`PyErr_SetRaisedException`.
11+
* :c:func:`PyModule_GetFilename`: use :c:func:`PyModule_GetFilenameObject`.
12+
* :c:func:`PyOS_AfterFork`: use :c:func:`PyOS_AfterFork_Child()`.
13+
* :c:func:`PySlice_GetIndicesEx`.
14+
* :c:func:`!PyUnicode_AsDecodedObject`.
15+
* :c:func:`!PyUnicode_AsDecodedUnicode`.
16+
* :c:func:`!PyUnicode_AsEncodedObject`.
17+
* :c:func:`!PyUnicode_AsEncodedUnicode`.
18+
* :c:func:`PyUnicode_READY`: not needed since Python 3.12.
19+
* :c:func:`!_PyErr_ChainExceptions`.
20+
* :c:member:`!PyBytesObject.ob_shash` member:
21+
call :c:func:`PyObject_Hash` instead.
22+
* :c:member:`!PyDictObject.ma_version_tag` member.
23+
* TLS API:
24+
25+
* :c:func:`PyThread_create_key`: use :c:func:`PyThread_tss_alloc`.
26+
* :c:func:`PyThread_delete_key`: use :c:func:`PyThread_tss_free`.
27+
* :c:func:`PyThread_set_key_value`: use :c:func:`PyThread_tss_set`.
28+
* :c:func:`PyThread_get_key_value`: use :c:func:`PyThread_tss_get`.
29+
* :c:func:`PyThread_delete_key_value`: use :c:func:`PyThread_tss_delete`.
30+
* :c:func:`PyThread_ReInitTLS`: no longer needed.
31+
32+
* Remove undocumented ``PY_TIMEOUT_MAX`` constant from the limited C API.
33+
(Contributed by Victor Stinner in :gh:`110014`.)

Doc/whatsnew/3.13.rst

Lines changed: 3 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -2550,105 +2550,11 @@ Deprecated C APIs
25502550
Refer to the deprecation notices on each function for their recommended replacements.
25512551
(Soft deprecated as part of :pep:`667`.)
25522552

2553-
Pending Removal in Python 3.14
2554-
------------------------------
2555-
2556-
* Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable
2557-
bases using the C API.
2558-
2559-
* Functions to configure the Python initialization, deprecated in Python 3.11:
2560-
2561-
* ``PySys_SetArgvEx()``: set :c:member:`PyConfig.argv` instead.
2562-
* ``PySys_SetArgv()``: set :c:member:`PyConfig.argv` instead.
2563-
* ``Py_SetProgramName()``: set :c:member:`PyConfig.program_name` instead.
2564-
* ``Py_SetPythonHome()``: set :c:member:`PyConfig.home` instead.
2565-
2566-
The :c:func:`Py_InitializeFromConfig` API should be used with
2567-
:c:type:`PyConfig` instead.
2568-
2569-
* Global configuration variables:
2570-
2571-
* :c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`
2572-
* :c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`
2573-
* :c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`
2574-
* :c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`
2575-
* :c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`
2576-
* :c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`
2577-
* :c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import`
2578-
* :c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`
2579-
* :c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`
2580-
* :c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`
2581-
* :c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`
2582-
* :c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`
2583-
* :c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`
2584-
* :c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed`
2585-
and :c:member:`PyConfig.hash_seed`
2586-
* :c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`
2587-
* :c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig.legacy_windows_fs_encoding`
2588-
* :c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig.legacy_windows_stdio`
2589-
* :c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig.filesystem_encoding`
2590-
* :c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig.filesystem_encoding`
2591-
* :c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig.filesystem_errors`
2592-
* :c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:`Py_PreInitialize`)
2593-
2594-
The :c:func:`Py_InitializeFromConfig` API should be used with
2595-
:c:type:`PyConfig` instead.
2596-
2597-
Pending Removal in Python 3.15
2598-
------------------------------
2599-
2600-
* The bundled copy of ``libmpdecimal``.
2601-
* :c:func:`PyImport_ImportModuleNoBlock`: use :c:func:`PyImport_ImportModule`.
2602-
* :c:func:`PyWeakref_GET_OBJECT`: use :c:func:`PyWeakref_GetRef` instead.
2603-
* :c:func:`PyWeakref_GetObject`: use :c:func:`PyWeakref_GetRef` instead.
2604-
* :c:type:`!Py_UNICODE_WIDE` type: use :c:type:`wchar_t` instead.
2605-
* :c:type:`Py_UNICODE` type: use :c:type:`wchar_t` instead.
2606-
* Python initialization functions:
2607-
2608-
* :c:func:`PySys_ResetWarnOptions`: clear :data:`sys.warnoptions` and
2609-
:data:`!warnings.filters` instead.
2610-
* :c:func:`Py_GetExecPrefix`: get :data:`sys.exec_prefix` instead.
2611-
* :c:func:`Py_GetPath`: get :data:`sys.path` instead.
2612-
* :c:func:`Py_GetPrefix`: get :data:`sys.prefix` instead.
2613-
* :c:func:`Py_GetProgramFullPath`: get :data:`sys.executable` instead.
2614-
* :c:func:`Py_GetProgramName`: get :data:`sys.executable` instead.
2615-
* :c:func:`Py_GetPythonHome`: get :c:member:`PyConfig.home` or
2616-
:envvar:`PYTHONHOME` environment variable instead.
2617-
2618-
Pending Removal in Future Versions
2619-
----------------------------------
2553+
.. include:: ../deprecations/pending-removal-in-3.14.rst
26202554

2621-
The following APIs were deprecated in earlier Python versions and will be
2622-
removed, although there is currently no date scheduled for their removal.
2623-
2624-
* :c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: no needed since Python 3.8.
2625-
* :c:func:`PyErr_Fetch`: use :c:func:`PyErr_GetRaisedException`.
2626-
* :c:func:`PyErr_NormalizeException`: use :c:func:`PyErr_GetRaisedException`.
2627-
* :c:func:`PyErr_Restore`: use :c:func:`PyErr_SetRaisedException`.
2628-
* :c:func:`PyModule_GetFilename`: use :c:func:`PyModule_GetFilenameObject`.
2629-
* :c:func:`PyOS_AfterFork`: use :c:func:`PyOS_AfterFork_Child()`.
2630-
* :c:func:`PySlice_GetIndicesEx`.
2631-
* :c:func:`!PyUnicode_AsDecodedObject`.
2632-
* :c:func:`!PyUnicode_AsDecodedUnicode`.
2633-
* :c:func:`!PyUnicode_AsEncodedObject`.
2634-
* :c:func:`!PyUnicode_AsEncodedUnicode`.
2635-
* :c:func:`PyUnicode_READY`: not needed since Python 3.12.
2636-
* :c:func:`!_PyErr_ChainExceptions`.
2637-
* :c:member:`!PyBytesObject.ob_shash` member:
2638-
call :c:func:`PyObject_Hash` instead.
2639-
* :c:member:`!PyDictObject.ma_version_tag` member.
2640-
* TLS API:
2641-
2642-
* :c:func:`PyThread_create_key`: use :c:func:`PyThread_tss_alloc`.
2643-
* :c:func:`PyThread_delete_key`: use :c:func:`PyThread_tss_free`.
2644-
* :c:func:`PyThread_set_key_value`: use :c:func:`PyThread_tss_set`.
2645-
* :c:func:`PyThread_get_key_value`: use :c:func:`PyThread_tss_get`.
2646-
* :c:func:`PyThread_delete_key_value`: use :c:func:`PyThread_tss_delete`.
2647-
* :c:func:`PyThread_ReInitTLS`: no longer needed.
2648-
2649-
* Remove undocumented ``PY_TIMEOUT_MAX`` constant from the limited C API.
2650-
(Contributed by Victor Stinner in :gh:`110014`.)
2555+
.. include:: ../deprecations/pending-removal-in-3.15.rst
26512556

2557+
.. include:: ../deprecations/pending-removal-in-future.rst
26522558

26532559
Regression Test Changes
26542560
=======================

0 commit comments

Comments
 (0)