('c:data', 'PyExc_UnicodeWarning'),
('c:data', 'PyExc_UserWarning'),
('c:data', 'PyExc_Warning'),
+ # Undocumented public C macros
+ ('c:macro', 'Py_BUILD_ASSERT'),
+ ('c:macro', 'Py_BUILD_ASSERT_EXPR'),
# Do not error nit-picky mode builds when _SubParsersAction.add_parser cannot
# be resolved, as the method is currently undocumented. For context, see
# https://github.com/python/cpython/pull/103289.
As the :class:`cProfile.Profile` class cannot be calibrated, custom timer
functions should be used with care and should be as fast as possible. For
the best results with a custom timer, it might be necessary to hard-code it
- in the C source of the internal :mod:`_lsprof` module.
+ in the C source of the internal :mod:`!_lsprof` module.
Python 3.3 adds several new functions in :mod:`time` that can be used to make
precise measurements of process or wall-clock time. For example, see
from typing import TextIO
# Fail if NEWS nit found before this line number
-NEWS_NIT_THRESHOLD = 200
+NEWS_NIT_THRESHOLD = 300
# Exclude these whether they're dirty or clean,
# because they trigger a rebuild of dirty files.
stat
----
-The :mod:`stat` module is now backed by a C implementation in :mod:`_stat`. A C
+The :mod:`stat` module is now backed by a C implementation in :mod:`!_stat`. A C
implementation is required as most of the values aren't standardized and
are platform-dependent. (Contributed by Christian Heimes in :issue:`11016`.)
tkinter
-------
-The :mod:`tkinter._fix` module used for setting up the Tcl/Tk environment
-on Windows has been replaced by a private function in the :mod:`_tkinter`
+The :mod:`!tkinter._fix` module used for setting up the Tcl/Tk environment
+on Windows has been replaced by a private function in the :mod:`!_tkinter`
module which makes no permanent changes to environment variables.
(Contributed by Zachary Ware in :issue:`20035`.)
threading
---------
-:mod:`dummy_threading` and :mod:`_dummy_thread` have been deprecated. It is
+:mod:`!dummy_threading` and :mod:`!_dummy_thread` have been deprecated. It is
no longer possible to build Python with threading disabled.
Use :mod:`threading` instead.
(Contributed by Antoine Pitrou in :issue:`31370`.)
``socket.socketpair`` on Python 3.5 and newer.
* :mod:`asyncio` no longer exports the :mod:`selectors` and
- :mod:`_overlapped` modules as ``asyncio.selectors`` and
+ :mod:`!_overlapped` modules as ``asyncio.selectors`` and
``asyncio._overlapped``. Replace ``from asyncio import selectors`` with
``import selectors``.
- Issue #18626: the inspect module now offers a basic command line
introspection interface (Initial patch by Claudiu Popa)
-- Issue #3015: Fixed tkinter with wantobject=False. Any Tcl command call
+- Issue #3015: Fixed tkinter with ``wantobjects=False``. Any Tcl command call
returned empty string.
- Issue #19037: The mailbox module now makes all changes to maildir files
.. nonce: aJS9B3
.. section: Core and Builtins
-Port the :mod:`_bisect` module to the multi-phase initialization API
+Port the :mod:`!_bisect` module to the multi-phase initialization API
(:pep:`489`).
..
.. nonce: lh335O
.. section: Core and Builtins
-Port the :mod:`_lsprof` extension module to multi-phase initialization
+Port the :mod:`!_lsprof` extension module to multi-phase initialization
(:pep:`489`).
..
.. nonce: jiXmyT
.. section: Core and Builtins
-Port the :mod:`_scproxy` extension module to multi-phase initialization
+Port the :mod:`!_scproxy` extension module to multi-phase initialization
(:pep:`489`).
..
.. nonce: QuDIut
.. section: Core and Builtins
-Convert the :mod:`_sha256` extension module types to heap types.
+Convert the :mod:`!_sha256` extension module types to heap types.
..
.. nonce: CnRME3
.. section: Core and Builtins
-Port the :mod:`_overlapped` extension module to multi-phase initialization
+Port the :mod:`!_overlapped` extension module to multi-phase initialization
(:pep:`489`).
..
.. nonce: X9CZgo
.. section: Core and Builtins
-Port the :mod:`_curses_panel` extension module to multi-phase initialization
+Port the :mod:`!_curses_panel` extension module to multi-phase initialization
(:pep:`489`).
..
.. nonce: 5jZymK
.. section: Core and Builtins
-Port the :mod:`_opcode` extension module to multi-phase initialization
+Port the :mod:`!_opcode` extension module to multi-phase initialization
(:pep:`489`).
..
.. nonce: vcxSUa
.. section: Core and Builtins
-Convert :mod:`_operator` to use :c:func:`PyType_FromSpec`.
+Convert :mod:`!_operator` to use :c:func:`PyType_FromSpec`.
..
.. nonce: fubBkb
.. section: Core and Builtins
-Port :mod:`_sha3` to multi-phase init. Convert static types to heap types.
+Port :mod:`!_sha3` to multi-phase init. Convert static types to heap types.
..
.. nonce: FC13e7
.. section: Core and Builtins
-Port the :mod:`_blake2` extension module to the multi-phase initialization
+Port the :mod:`!_blake2` extension module to the multi-phase initialization
API (:pep:`489`).
..
.. nonce: O0d3ym
.. section: Core and Builtins
-Port the :mod:`_sha1`, :mod:`_sha512`, and :mod:`_md5` extension modules to
+Port the :mod:`!_sha1`, :mod:`!_sha512`, and :mod:`!_md5` extension modules to
multi-phase initialization API (:pep:`489`).
..
.. nonce: _yI-ax
.. section: Core and Builtins
-Convert :mod:`_bz2` to use :c:func:`PyType_FromSpec`.
+Convert :mod:`!_bz2` to use :c:func:`PyType_FromSpec`.
..
.. nonce: 61iyYh
.. section: Core and Builtins
-Port :mod:`_gdbm` to multiphase initialization.
+Port :mod:`!_gdbm` to multiphase initialization.
..
.. nonce: mmlp3Q
.. section: Core and Builtins
-Port :mod:`_dbm` to multiphase initialization.
+Port :mod:`!_dbm` to multiphase initialization.
..
.. nonce: Kfe9fT
.. section: Core and Builtins
-Port :mod:`_lzma` to multiphase initialization.
+Port :mod:`!_lzma` to multiphase initialization.
..
.. nonce: 85BsRA
.. section: Library
-Fix an incorrectly formatted error from :meth:`_codecs.charmap_decode` when
+Fix an incorrectly formatted error from :meth:`!_codecs.charmap_decode` when
called with a mapped value outside the range of valid Unicode code points.
PR by Max Bernstein.
The ``Py_TRASHCAN_BEGIN`` macro no longer accesses PyTypeObject attributes,
but now can get the condition by calling the new private
-:c:func:`_PyTrash_cond()` function which hides implementation details.
+:c:func:`!_PyTrash_cond()` function which hides implementation details.
..
.. nonce: j7nl6A
.. section: Core and Builtins
-Make :c:func:`_PyUnicode_FromId` function compatible with subinterpreters.
+Make :c:func:`!_PyUnicode_FromId` function compatible with subinterpreters.
Each interpreter now has an array of identifier objects (interned strings
decoded from UTF-8). Patch by Victor Stinner.
.. nonce: Quy3zn
.. section: Library
-Port the :mod:`_thread` extension module to the multiphase initialization
+Port the :mod:`!_thread` extension module to the multiphase initialization
API (:pep:`489`) and convert its static types to heap types.
..
.. nonce: Je08Ny
.. section: C API
-Remove the private :c:func:`_Py_fopen` function which is no longer needed.
-Use :c:func:`_Py_wfopen` or :c:func:`_Py_fopen_obj` instead. Patch by Victor
+Remove the private :c:func:`!_Py_fopen` function which is no longer needed.
+Use :c:func:`!_Py_wfopen` or :c:func:`!_Py_fopen_obj` instead. Patch by Victor
Stinner.
..
.. nonce: WfTdfg
.. section: Core and Builtins
-Fix the :c:func:`_PyUnicode_FromId` function (_Py_IDENTIFIER(var) API) when
+Fix the :c:func:`!_PyUnicode_FromId` function (_Py_IDENTIFIER(var) API) when
:c:func:`Py_Initialize` / :c:func:`Py_Finalize` is called multiple times:
preserve ``_PyRuntime.unicode_ids.next_index`` value.
.. section: Library
Make the pure Python implementation of :mod:`xml.etree.ElementTree` behave
-the same as the C implementation (:mod:`_elementree`) regarding default
+the same as the C implementation (:mod:`!_elementree`) regarding default
attribute values (by not setting ``specified_attributes=1``).
..
.. nonce: PhaT-B
.. section: Core and Builtins
-Fix reference leak in the :mod:`_hashopenssl` extension. Patch by Pablo
+Fix reference leak in the :mod:`!_hashopenssl` extension. Patch by Pablo
Galindo.
..
.. nonce: u5Y6bS
.. section: Core and Builtins
-Importing the :mod:`_signal` module in a subinterpreter has no longer side
+Importing the :mod:`!_signal` module in a subinterpreter has no longer side
effects.
..
.. nonce: o1zEk_
.. section: Library
-The Python :func:`_pyio.open` function becomes a static method to behave as
+The Python :func:`!_pyio.open` function becomes a static method to behave as
:func:`io.open` built-in function: don't become a bound method when stored
as a class variable. It becomes possible since static methods are now
-callable in Python 3.10. Moreover, :func:`_pyio.OpenWrapper` becomes a
-simple alias to :func:`_pyio.open`. Patch by Victor Stinner.
+callable in Python 3.10. Moreover, :func:`!_pyio.OpenWrapper` becomes a
+simple alias to :func:`!_pyio.open`. Patch by Victor Stinner.
..
.. section: Core and Builtins
Expose specialization stats in python via
-:func:`_opcode.get_specialization_stats`.
+:func:`!_opcode.get_specialization_stats`.
..
.. nonce: y1kEfP
.. section: Library
-Remove the deprecated ``split()`` method of :class:`_tkinter.TkappType`.
+Remove the deprecated ``split()`` method of :class:`!_tkinter.TkappType`.
Patch by Erlend E. Aasland.
..
.. nonce: ThuDMI
.. section: Library
-Fixed a bug in the :mod:`_ssl` module that was throwing :exc:`OverflowError`
-when using :meth:`_ssl._SSLSocket.write` and :meth:`_ssl._SSLSocket.read`
-for a big value of the ``len`` parameter. Patch by Pablo Galindo
+Fixed a bug in the :mod:`!_ssl` module that was throwing :exc:`OverflowError`
+when using :meth:`!_ssl._SSLSocket.write` and :meth:`!_ssl._SSLSocket.read`
+for a big value of the ``len`` parameter. Patch by Pablo Galindo.
..
.. nonce: R3IcM1
.. section: Library
-Fix memory leak in :func:`_tkinter._flatten` if it is called with a sequence
+Fix memory leak in :func:`!_tkinter._flatten` if it is called with a sequence
or set, but not list or tuple.
..
.. nonce: mQZdXU
.. section: Tests
-Made tests relying on the :mod:`_asyncio` C extension module optional to
+Made tests relying on the :mod:`!_asyncio` C extension module optional to
allow running on alternative Python implementations. Patch by Serhiy
Storchaka.
.. section: Core and Builtins
:data:`sys.stdlib_module_names` now contains the macOS-specific module
-:mod:`_scproxy`.
+:mod:`!_scproxy`.
..
.. nonce: 61gM2A
.. section: Build
-:mod:`pyexpat` and :mod:`_elementtree` no longer define obsolete macros
+:mod:`pyexpat` and :mod:`!_elementtree` no longer define obsolete macros
``HAVE_EXPAT_CONFIG_H`` and ``USE_PYEXPAT_CAPI``. ``XML_POOR_ENTROPY`` is
now defined in ``expat_config.h``.
.. nonce: 3TmTSw
.. section: Core and Builtins
-:c:func:`_PyErr_ChainStackItem` no longer normalizes ``exc_info`` (including
+:c:func:`!_PyErr_ChainStackItem` no longer normalizes ``exc_info`` (including
setting the traceback on the exception instance) because ``exc_info`` is
always normalized.
.. nonce: ADVaPT
.. section: Core and Builtins
-The code called from :c:func:`_PyErr_Display` was refactored to improve
+The code called from :c:func:`!_PyErr_Display` was refactored to improve
error handling. It now exits immediately upon an unrecoverable error.
..
.. nonce: 11YXHQ
.. section: Core and Builtins
-Add a new :c:func:`_PyFrame_IsEntryFrame` API function, to check if a
+Add a new :c:func:`!_PyFrame_IsEntryFrame` API function, to check if a
:c:type:`PyFrameObject` is an entry frame. Patch by Pablo Galindo.
..
.. section: Core and Builtins
Added unicode check for ``name`` attribute of ``spec`` argument passed in
-:func:`_imp.create_builtin` function.
+:func:`!_imp.create_builtin` function.
..
.. nonce: AfCi36
.. section: Core and Builtins
-Convert :mod:`_functools` to argument clinic.
+Convert :mod:`!_functools` to argument clinic.
..
.. nonce: wky0Fc
.. section: Core and Builtins
-Do not expose ``KeyWrapper`` in :mod:`_functools`.
+Do not expose ``KeyWrapper`` in :mod:`!_functools`.
..
.. nonce: lenv9h
.. section: Core and Builtins
-:meth:`_warnings.warn_explicit` is ported to Argument Clinic.
+:meth:`!_warnings.warn_explicit` is ported to Argument Clinic.
..
.. nonce: VhS1eS
.. section: Library
-Made :class:`_struct.Struct` GC-tracked in order to fix a reference leak in
-the :mod:`_struct` module.
+Made :class:`!_struct.Struct` GC-tracked in order to fix a reference leak in
+the :mod:`!_struct` module.
..
Remove ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated in Python
3.10: just use :func:`open` instead. The :func:`open` (:func:`io.open`)
-function is a built-in function. Since Python 3.10, :func:`_pyio.open` is
+function is a built-in function. Since Python 3.10, :func:`!_pyio.open` is
also a static method. Patch by Victor Stinner.
..
Support native Windows case-insensitive path comparisons by using
``LCMapStringEx`` instead of :func:`str.lower` in :func:`ntpath.normcase`.
-Add ``LCMapStringEx`` to the :mod:`_winapi` module.
+Add ``LCMapStringEx`` to the :mod:`!_winapi` module.
..
.. nonce: Ai2KDh
.. section: Library
-Now :mod:`_pyio` is consistent with :mod:`_io` in raising ``ValueError``
+Now :mod:`!_pyio` is consistent with :mod:`!_io` in raising ``ValueError``
when executing methods over closed buffers.
..
.. nonce: 0v8iyw
.. section: Library
-Clean up refleak on failed module initialisation in :mod:`_zoneinfo`
+Clean up refleak on failed module initialisation in :mod:`!_zoneinfo`
..
.. nonce: qc_KHr
.. section: Library
-Clean up refleaks on failed module initialisation in :mod:`_pickle`
+Clean up refleaks on failed module initialisation in :mod:`!_pickle`
..
.. nonce: LBl79O
.. section: Library
-Clean up refleak on failed module initialisation in :mod:`_io`.
+Clean up refleak on failed module initialisation in :mod:`!_io`.
..
.. nonce: DcKoBJ
.. section: Core and Builtins
-Fix a reference bug in :func:`_imp.create_builtin()` after the creation of
+Fix a reference bug in :func:`!_imp.create_builtin` after the creation of
the first sub-interpreter for modules ``builtins`` and ``sys``. Patch by
Victor Stinner.
Improve ``BUILD_LIST`` opcode so that it works similarly to the
``BUILD_TUPLE`` opcode, by stealing references from the stack rather than
repeatedly using stack operations to set list elements. Implementation
-details are in a new private API :c:func:`_PyList_FromArraySteal`.
+details are in a new private API :c:func:`!_PyList_FromArraySteal`.
..
.. nonce: 511Tbh
.. section: Library
-Convert private :meth:`_posixsubprocess.fork_exec` to use Argument Clinic.
+Convert private :meth:`!_posixsubprocess.fork_exec` to use Argument Clinic.
..
.. section: Library
Fix :func:`io.BufferedReader.tell`, :func:`io.BufferedReader.seek`,
-:func:`_pyio.BufferedReader.tell`, :func:`io.BufferedRandom.tell`,
-:func:`io.BufferedRandom.seek` and :func:`_pyio.BufferedRandom.tell` being
+:func:`!_pyio.BufferedReader.tell`, :func:`io.BufferedRandom.tell`,
+:func:`io.BufferedRandom.seek` and :func:`!_pyio.BufferedRandom.tell` being
able to return negative offsets.
..
.. nonce: FE_PII
.. section: Library
-_tkinter.create() now creates tkapp object with wantobject=1 by default.
+``_tkinter.create()`` now creates ``tkapp`` object with ``wantobjects=1`` by
+default.
..
.. nonce: RWN1jR
.. section: Library
-Add C functions :c:func:`_PyTraceMalloc_Track` and
-:c:func:`_PyTraceMalloc_Untrack` to track memory blocks using the
-:mod:`tracemalloc` module. Add :c:func:`_PyTraceMalloc_GetTraceback` to get
+Add C functions :c:func:`!_PyTraceMalloc_Track` and
+:c:func:`!_PyTraceMalloc_Untrack` to track memory blocks using the
+:mod:`tracemalloc` module. Add :c:func:`!_PyTraceMalloc_GetTraceback` to get
the traceback of an object.
..
.. nonce: dQS1ng
.. section: Library
-Fix incorrect parsing of :class:`_io.IncrementalNewlineDecoder`'s
+Fix incorrect parsing of :class:`io.IncrementalNewlineDecoder`'s
*translate* argument.
..
.. nonce: K6jCVG
.. section: macOS
-In :mod:`_scproxy`, drop the GIL when calling into ``SystemConfiguration``
+In :mod:`!_scproxy`, drop the GIL when calling into ``SystemConfiguration``
to avoid deadlocks.
..
.. nonce: __FTq9
.. section: Tests
-Add a new :mod:`_testinternalcapi` module to test the internal C API.
+Add a new :mod:`!_testinternalcapi` module to test the internal C API.
..
coerced and/or if the UTF-8 Mode is enabled by the user configuration. The
LC_CTYPE coercion and UTF-8 Mode are now disabled by default to fix the
mojibake issue. They must now be enabled explicitly (opt-in) using the new
-:c:func:`_Py_PreInitialize` API with ``_PyPreConfig``.
+:c:func:`!_Py_PreInitialize` API with ``_PyPreConfig``.
..
.. nonce: sLULGQ
.. section: Library
-Fix destructor :class:`_pyio.BytesIO` and :class:`_pyio.TextIOWrapper`:
+Fix destructor :class:`!_pyio.BytesIO` and :class:`!_pyio.TextIOWrapper`:
initialize their ``_buffer`` attribute as soon as possible (in the class
body), because it's used by ``__del__()`` which calls ``close()``.
.. nonce: hwrPN7
.. section: Library
-Prevent :exc:`KeyError` thrown by :func:`_encoded_words.decode` when given
+Prevent :exc:`KeyError` thrown by :func:`!_encoded_words.decode` when given
an encoded-word with invalid content-type encoding from propagating all the
way to :func:`email.message.get`.
.. nonce: S6Klvm
.. section: Library
-Deprecated the ``split()`` method in :class:`_tkinter.TkappType` in favour
+Deprecated the ``split()`` method in :class:`!_tkinter.TkappType` in favour
of the ``splitlist()`` method which has more consistent and predictable
behavior.
.. section: Library
Allow pure Python implementation of :mod:`pickle` to work even when the C
-:mod:`_pickle` module is unavailable.
+:mod:`!_pickle` module is unavailable.
..
.. nonce: ADqCkq
.. section: Library
-:class:`_pyio.IOBase` destructor now does nothing if getting the ``closed``
-attribute fails to better mimic :class:`_io.IOBase` finalizer.
+:class:`!_pyio.IOBase` destructor now does nothing if getting the ``closed``
+attribute fails to better mimic :class:`!_io.IOBase` finalizer.
..
.. section: Windows
Replace use of :c:func:`strcasecmp` for the system function
-:c:func:`_stricmp`. Patch by Minmin Gong.
+:c:func:`!_stricmp`. Patch by Minmin Gong.
..
.. section: C API
Add fast functions for calling methods:
-:c:func:`_PyObject_VectorcallMethod`, :c:func:`_PyObject_CallMethodNoArgs`
-and :c:func:`_PyObject_CallMethodOneArg`.
+:c:func:`!_PyObject_VectorcallMethod`, :c:func:`!_PyObject_CallMethodNoArgs`
+and :c:func:`!_PyObject_CallMethodOneArg`.
..
.. nonce: m15TTX
.. section: Core and Builtins
-Fix possible refleaks in :mod:`_json`, memo of PyScannerObject should be
+Fix possible refleaks in :mod:`!_json`, memo of PyScannerObject should be
traversed.
..
.. nonce: VTq_8s
.. section: Library
-Add a private ``_at_fork_reinit()`` method to :class:`_thread.Lock`,
-:class:`_thread.RLock`, :class:`threading.RLock` and
+Add a private ``_at_fork_reinit()`` method to :class:`!_thread.Lock`,
+:class:`!_thread.RLock`, :class:`threading.RLock` and
:class:`threading.Condition` classes: reinitialize the lock at fork in the
child process, reset the lock to the unlocked state. Rename also the private
``_reset_internal_locks()`` method of :class:`threading.Event` to