Extension export hook
.....................
-.. versionadded:: next
+.. versionadded:: 3.15
Support for the :samp:`PyModExport_{<name>}` export hook was added in Python
3.15. The older way of defining modules is still available: consult either
``PyInit`` function
...................
-.. deprecated:: next
+.. deprecated:: 3.15
This functionality is :term:`soft deprecated`.
It will not get new features, but there are no plans to remove it.
Legacy single-phase initialization
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. deprecated:: next
+.. deprecated:: 3.15
Single-phase initialization is :term:`soft deprecated`.
It is a legacy mechanism to initialize extension
array of :dfn:`slots`.
The slots provide a "description" of how a module should be created.
-.. versionchanged:: next
+.. versionchanged:: 3.15
Previously, a :c:type:`PyModuleDef` struct was necessary to define modules.
The older way of defining modules is still available: consult either the
However, it is still recommended to include this slot for introspection
and debugging purposes.
- .. versionadded:: next
+ .. versionadded:: 3.15
Use :c:member:`PyModuleDef.m_name` instead to support previous versions.
Usually it is set to a variable created with :c:macro:`PyDoc_STRVAR`.
- .. versionadded:: next
+ .. versionadded:: 3.15
Use :c:member:`PyModuleDef.m_doc` instead to support previous versions.
.. versionadded:: 3.5
- .. versionchanged:: next
+ .. versionchanged:: 3.15
The *slots* argument may be a ``ModuleSpec``-like object, rather than
a true :py:class:`~importlib.machinery.ModuleSpec` instance.
.. versionadded:: 3.5
- .. versionchanged:: next
+ .. versionchanged:: 3.15
Repeated ``Py_mod_exec`` slots are disallowed, except in
:c:type:`PyModuleDef.m_slots`.
The table must be statically allocated (or otherwise guaranteed to outlive
the module object).
- .. versionadded:: next
+ .. versionadded:: 3.15
Use :c:member:`PyModuleDef.m_methods` instead to support previous versions.
On error, set *\*result* to -1, and return -1 with an exception set.
- .. versionadded:: next
+ .. versionadded:: 3.15
Use :c:func:`PyModule_GetStateSize` to retrieve the size of a given module.
- .. versionadded:: next
+ .. versionadded:: 3.15
Use :c:member:`PyModuleDef.m_size` instead to support previous versions.
(:c:data:`Py_mod_state_size`) is greater than 0 and the module state
(as returned by :c:func:`PyModule_GetState`) is ``NULL``.
- .. versionadded:: next
+ .. versionadded:: 3.15
Use :c:member:`PyModuleDef.m_size` instead to support previous versions.
the cyclic garbage collector is not involved and
the :c:macro:`Py_mod_state_free` function is called directly.
- .. versionadded:: next
+ .. versionadded:: 3.15
Use :c:member:`PyModuleDef.m_clear` instead to support previous versions.
(:c:data:`Py_mod_state_size`) is greater than 0 and the module state
(as returned by :c:func:`PyModule_GetState`) is ``NULL``.
- .. versionadded:: next
+ .. versionadded:: 3.15
Use :c:member:`PyModuleDef.m_free` instead to support previous versions.
This means that :c:macro:`!Py_mod_token` cannot be used in
:c:member:`PyModuleDef.m_slots`.
- .. versionadded:: next
+ .. versionadded:: 3.15
.. c:function:: int PyModule_GetToken(PyObject *module, void** result)
On error, set *\*result* to NULL, and return -1 with an exception set.
- .. versionadded:: next
+ .. versionadded:: 3.15
See also :c:func:`PyType_GetModuleByToken`.
:c:func:`!PyModule_FromSlotsAndSpec` call.
In particular, it may be heap-allocated.
- .. versionadded:: next
+ .. versionadded:: 3.15
.. c:function:: int PyModule_Exec(PyObject *module)
:ref:`legacy single-phase initialization <single-phase-initialization>`,
this function does nothing and returns 0.
- .. versionadded:: next
+ .. versionadded:: 3.15
object type name: str
object repr : 'abcdef'
- .. versionadded:: next
+ .. versionadded:: 3.15
.. c:function:: int PyObject_HasAttrWithError(PyObject *o, PyObject *attr_name)
and other places where a method's defining class cannot be passed using the
:c:type:`PyCMethod` calling convention.
- .. versionadded:: next
+ .. versionadded:: 3.15
.. c:function:: PyObject* PyType_GetModuleByDef(PyTypeObject *type, struct PyModuleDef *def)
>>> parser.parse_args('--foo XXX'.split())
Namespace(bar='XXX')
-.. versionchanged:: next
+.. versionchanged:: 3.15
Single-dash long option now takes precedence over short options.
.. versionadded:: 3.9
- .. versionchanged:: next
+ .. versionchanged:: 3.15
Added support for single-dash options.
Added support for alternate prefix_chars_.
.. versionadded:: 3.4
- .. versionchanged:: next
+ .. versionchanged:: 3.15
Add ``duration`` and ``candidates``.
.. versionadded:: 3.3
- .. versionchanged:: next
+ .. versionchanged:: 3.15
Add "duration" and "candidates".
:exc:`ModuleNotFoundError` is raised when the module being reloaded lacks
a :class:`~importlib.machinery.ModuleSpec`.
- .. versionchanged:: next
+ .. versionchanged:: 3.15
If *module* is a lazy module that has not yet been materialized (i.e.,
loaded via :class:`importlib.util.LazyLoader` and not yet accessed),
calling :func:`reload` is a no-op and returns the module unchanged.
function has been set. This function only exists if Python was compiled
for a version of the library that supports it.
- .. versionadded:: next
+ .. versionadded:: 3.15
.. _readline-completion:
.. versionchanged:: 3.14
Added support for ``TCP_QUICKACK`` on Windows platforms when available.
- .. versionchanged:: next
+ .. versionchanged:: 3.15
``IPV6_HDRINCL`` was added.
of the iterator's values. However, the *__slots__* attribute will be an empty
iterator.
-.. versionchanged:: next
+.. versionchanged:: 3.15
Allowed defining the *__dict__* and *__weakref__* *__slots__* for any class.
"_tkinter": "Install the python-tk package to use tkinter",
}
- .. versionadded:: next
+ .. versionadded:: 3.15
.. option:: --enable-pystats
#define PY_MINOR_VERSION 15
#define PY_MICRO_VERSION 0
#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA
-#define PY_RELEASE_SERIAL 2
+#define PY_RELEASE_SERIAL 3
/* Version as a string */
-#define PY_VERSION "3.15.0a2+"
+#define PY_VERSION "3.15.0a3"
/*--end constants--*/
-# Autogenerated by Sphinx on Tue Nov 18 16:51:09 2025
+# Autogenerated by Sphinx on Tue Dec 16 14:26:04 2025
# as part of the release process.
topics = {
renders the meaning of the program undefined. In the future, a
check may be added to prevent this.
-* "TypeError" will be raised if nonempty *__slots__* are defined for a
- class derived from a ""variable-length" built-in type" such as
- "int", "bytes", and "tuple".
+* "TypeError" will be raised if *__slots__* other than *__dict__* and
+ *__weakref__* are defined for a class derived from a ""variable-
+ length" built-in type" such as "int", "bytes", and "tuple".
* Any non-string *iterable* may be assigned to *__slots__*.
* If an *iterator* is used for *__slots__* then a *descriptor* is
created for each of the iterator’s values. However, the *__slots__*
attribute will be an empty iterator.
+
+Changed in version 3.15.0a2 (unreleased): Allowed defining the
+*__dict__* and *__weakref__* *__slots__* for any class.
''',
'attribute-references': r'''Attribute references
********************
... except* BlockingIOError as e:
... print(repr(e))
...
- ExceptionGroup('', (BlockingIOError()))
+ ExceptionGroup('', (BlockingIOError(),))
"break", "continue" and "return" cannot appear in an "except*" clause.
If only keyword patterns are present, they are processed as
follows, one by one:
- I. The keyword is looked up as an attribute on the subject.
+ 1. The keyword is looked up as an attribute on the subject.
* If this raises an exception other than "AttributeError", the
exception bubbles up.
the class pattern fails; if this succeeds, the match proceeds
to the next keyword.
- II. If all keyword patterns succeed, the class pattern succeeds.
+ 2. If all keyword patterns succeed, the class pattern succeeds.
If any positional patterns are present, they are converted to
keyword patterns using the "__match_args__" attribute on the class
"name_or_attr" before matching:
- I. The equivalent of "getattr(cls, "__match_args__", ())" is
- called.
+ 1. The equivalent of "getattr(cls, "__match_args__", ())" is
+ called.
* If this raises an exception, the exception bubbles up.
Customizing positional arguments in class pattern matching
- II. Once all positional patterns have been converted to keyword
- patterns,
- the match proceeds as if there were only keyword patterns.
+ 2. Once all positional patterns have been converted to keyword
+ patterns, the match proceeds as if there were only keyword
+ patterns.
For the following built-in types the handling of positional
subpatterns is different:
| | With no precision given, uses a precision of "6" digits |
| | after the decimal point for "float", and shows all |
| | coefficient digits for "Decimal". If "p=0", the decimal |
- | | point is omitted unless the "#" option is used. |
+ | | point is omitted unless the "#" option is used. For |
+ | | "float", the exponent always contains at least two digits, |
+ | | and is zero if the value is zero. |
+-----------+------------------------------------------------------------+
| "'E'" | Scientific notation. Same as "'e'" except it uses an upper |
| | case ‘E’ as the separator character. |
"NAME" tokens represent *identifiers*, *keywords*, and *soft
keywords*.
-Within the ASCII range (U+0001..U+007F), the valid characters for
-names include the uppercase and lowercase letters ("A-Z" and "a-z"),
-the underscore "_" and, except for the first character, the digits "0"
-through "9".
-
-Names must contain at least one character, but have no upper length
-limit. Case is significant.
-
-Besides "A-Z", "a-z", "_" and "0-9", names can also use “letter-like”
-and “number-like” characters from outside the ASCII range, as detailed
-below.
-
-All identifiers are converted into the normalization form NFKC while
-parsing; comparison of identifiers is based on NFKC.
-
-Formally, the first character of a normalized identifier must belong
-to the set "id_start", which is the union of:
-
-* Unicode category "<Lu>" - uppercase letters (includes "A" to "Z")
-
-* Unicode category "<Ll>" - lowercase letters (includes "a" to "z")
+Names are composed of the following characters:
-* Unicode category "<Lt>" - titlecase letters
+* uppercase and lowercase letters ("A-Z" and "a-z"),
-* Unicode category "<Lm>" - modifier letters
+* the underscore ("_"),
-* Unicode category "<Lo>" - other letters
+* digits ("0" through "9"), which cannot appear as the first
+ character, and
-* Unicode category "<Nl>" - letter numbers
-
-* {""_""} - the underscore
-
-* "<Other_ID_Start>" - an explicit set of characters in PropList.txt
- to support backwards compatibility
+* non-ASCII characters. Valid names may only contain “letter-like” and
+ “digit-like” characters; see Non-ASCII characters in names for
+ details.
-The remaining characters must belong to the set "id_continue", which
-is the union of:
-
-* all characters in "id_start"
-
-* Unicode category "<Nd>" - decimal numbers (includes "0" to "9")
-
-* Unicode category "<Pc>" - connector punctuations
-
-* Unicode category "<Mn>" - nonspacing marks
-
-* Unicode category "<Mc>" - spacing combining marks
-
-* "<Other_ID_Continue>" - another explicit set of characters in
- PropList.txt to support backwards compatibility
-
-Unicode categories use the version of the Unicode Character Database
-as included in the "unicodedata" module.
-
-These sets are based on the Unicode standard annex UAX-31. See also
-**PEP 3131** for further details.
+Names must contain at least one character, but have no upper length
+limit. Case is significant.
-Even more formally, names are described by the following lexical
-definitions:
+Formally, names are described by the following lexical definitions:
- NAME: xid_start xid_continue*
- id_start: <Lu> | <Ll> | <Lt> | <Lm> | <Lo> | <Nl> | "_" | <Other_ID_Start>
- id_continue: id_start | <Nd> | <Pc> | <Mn> | <Mc> | <Other_ID_Continue>
- xid_start: <all characters in id_start whose NFKC normalization is
- in (id_start xid_continue*)">
- xid_continue: <all characters in id_continue whose NFKC normalization is
- in (id_continue*)">
- identifier: <NAME, except keywords>
+ NAME: name_start name_continue*
+ name_start: "a"..."z" | "A"..."Z" | "_" | <non-ASCII character>
+ name_continue: name_start | "0"..."9"
+ identifier: <NAME, except keywords>
-A non-normative listing of all valid identifier characters as defined
-by Unicode is available in the DerivedCoreProperties.txt file in the
-Unicode Character Database.
+Note that not all names matched by this grammar are valid; see Non-
+ASCII characters in names for details.
Keywords
context of a class definition, are re-written to use a mangled form
to help avoid name clashes between “private” attributes of base and
derived classes. See section Identifiers (Names).
+
+
+Non-ASCII characters in names
+=============================
+
+Names that contain non-ASCII characters need additional normalization
+and validation beyond the rules and grammar explained above. For
+example, "ř_1", "蛇", or "साँप" are valid names, but "r〰2", "€", or
+"🐍" are not.
+
+This section explains the exact rules.
+
+All names are converted into the normalization form NFKC while
+parsing. This means that, for example, some typographic variants of
+characters are converted to their “basic” form. For example,
+"fiⁿₐˡᵢᶻₐᵗᵢᵒₙ" normalizes to "finalization", so Python treats them as
+the same name:
+
+ >>> fiⁿₐˡᵢᶻₐᵗᵢᵒₙ = 3
+ >>> finalization
+ 3
+
+Note:
+
+ Normalization is done at the lexical level only. Run-time functions
+ that take names as *strings* generally do not normalize their
+ arguments. For example, the variable defined above is accessible at
+ run time in the "globals()" dictionary as
+ "globals()["finalization"]" but not "globals()["fiⁿₐˡᵢᶻₐᵗᵢᵒₙ"]".
+
+Similarly to how ASCII-only names must contain only letters, digits
+and the underscore, and cannot start with a digit, a valid name must
+start with a character in the “letter-like” set "xid_start", and the
+remaining characters must be in the “letter- and digit-like” set
+"xid_continue".
+
+These sets based on the *XID_Start* and *XID_Continue* sets as defined
+by the Unicode standard annex UAX-31. Python’s "xid_start"
+additionally includes the underscore ("_"). Note that Python does not
+necessarily conform to UAX-31.
+
+A non-normative listing of characters in the *XID_Start* and
+*XID_Continue* sets as defined by Unicode is available in the
+DerivedCoreProperties.txt file in the Unicode Character Database. For
+reference, the construction rules for the "xid_*" sets are given
+below.
+
+The set "id_start" is defined as the union of:
+
+* Unicode category "<Lu>" - uppercase letters (includes "A" to "Z")
+
+* Unicode category "<Ll>" - lowercase letters (includes "a" to "z")
+
+* Unicode category "<Lt>" - titlecase letters
+
+* Unicode category "<Lm>" - modifier letters
+
+* Unicode category "<Lo>" - other letters
+
+* Unicode category "<Nl>" - letter numbers
+
+* {""_""} - the underscore
+
+* "<Other_ID_Start>" - an explicit set of characters in PropList.txt
+ to support backwards compatibility
+
+The set "xid_start" then closes this set under NFKC normalization, by
+removing all characters whose normalization is not of the form
+"id_start id_continue*".
+
+The set "id_continue" is defined as the union of:
+
+* "id_start" (see above)
+
+* Unicode category "<Nd>" - decimal numbers (includes "0" to "9")
+
+* Unicode category "<Pc>" - connector punctuations
+
+* Unicode category "<Mn>" - nonspacing marks
+
+* Unicode category "<Mc>" - spacing combining marks
+
+* "<Other_ID_Continue>" - another explicit set of characters in
+ PropList.txt to support backwards compatibility
+
+Again, "xid_continue" closes this set under NFKC normalization.
+
+Unicode categories use the version of the Unicode Character Database
+as included in the "unicodedata" module.
+
+See also:
+
+ * **PEP 3131** – Supporting Non-ASCII Identifiers
+
+ * **PEP 672** – Unicode-related Security Considerations for Python
''',
'if': r'''The "if" statement
******************
renders the meaning of the program undefined. In the future, a
check may be added to prevent this.
-* "TypeError" will be raised if nonempty *__slots__* are defined for a
- class derived from a ""variable-length" built-in type" such as
- "int", "bytes", and "tuple".
+* "TypeError" will be raised if *__slots__* other than *__dict__* and
+ *__weakref__* are defined for a class derived from a ""variable-
+ length" built-in type" such as "int", "bytes", and "tuple".
* Any non-string *iterable* may be assigned to *__slots__*.
created for each of the iterator’s values. However, the *__slots__*
attribute will be an empty iterator.
+Changed in version 3.15.0a2 (unreleased): Allowed defining the
+*__dict__* and *__weakref__* *__slots__* for any class.
+
Customizing class creation
==========================
the numeric index of a positional argument, or the name of a
keyword argument. Returns a copy of the string where each
replacement field is replaced with the string value of the
- corresponding argument.
+ corresponding argument. For example:
- >>> "The sum of 1 + 2 is {0}".format(1+2)
- 'The sum of 1 + 2 is 3'
+ >>> "The sum of 1 + 2 is {0}".format(1+2)
+ 'The sum of 1 + 2 is 3'
+ >>> "The sum of {a} + {b} is {answer}".format(answer=1+2, a=1, b=2)
+ 'The sum of 1 + 2 is 3'
+ >>> "{1} expects the {0} Inquisition!".format("Spanish", "Nobody")
+ 'Nobody expects the Spanish Inquisition!'
See Format String Syntax for a description of the various
formatting options that can be specified in format strings.
database as “Letter”, i.e., those with general category property
being one of “Lm”, “Lt”, “Lu”, “Ll”, or “Lo”. Note that this is
different from the Alphabetic property defined in the section 4.10
- ‘Letters, Alphabetic, and Ideographic’ of the Unicode Standard.
+ ‘Letters, Alphabetic, and Ideographic’ of the Unicode Standard. For
+ example:
+
+ >>> 'Letters and spaces'.isalpha()
+ False
+ >>> 'LettersOnly'.isalpha()
+ True
+ >>> 'µ'.isalpha() # non-ASCII characters can be considered alphabetical too
+ True
+
+ See Unicode Properties.
str.isascii()
Return "True" if the string is empty or all characters in the
string are ASCII, "False" otherwise. ASCII characters have code
- points in the range U+0000-U+007F.
+ points in the range U+0000-U+007F. For example:
+
+ >>> 'ASCII characters'.isascii()
+ True
+ >>> 'µ'.isascii()
+ False
Added in version 3.7.
Return "True" if all characters in the string are decimal
characters and there is at least one character, "False" otherwise.
Decimal characters are those that can be used to form numbers in
- base 10, e.g. U+0660, ARABIC-INDIC DIGIT ZERO. Formally a decimal
- character is a character in the Unicode General Category “Nd”.
+ base 10, such as U+0660, ARABIC-INDIC DIGIT ZERO. Formally a
+ decimal character is a character in the Unicode General Category
+ “Nd”. For example:
+
+ >>> '0123456789'.isdecimal()
+ True
+ >>> '٠١٢٣٤٥٦٧٨٩'.isdecimal() # Arabic-Indic digits zero to nine
+ True
+ >>> 'alphabetic'.isdecimal()
+ False
str.isdigit()
that have the Unicode numeric value property, e.g. U+2155, VULGAR
FRACTION ONE FIFTH. Formally, numeric characters are those with
the property value Numeric_Type=Digit, Numeric_Type=Decimal or
- Numeric_Type=Numeric.
+ Numeric_Type=Numeric. For example:
+
+ >>> '0123456789'.isnumeric()
+ True
+ >>> '٠١٢٣٤٥٦٧٨٩'.isnumeric() # Arabic-indic digit zero to nine
+ True
+ >>> '⅕'.isnumeric() # Vulgar fraction one fifth
+ True
+ >>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric()
+ (False, True, True)
+
+ See also "isdecimal()" and "isdigit()". Numeric characters are a
+ superset of decimal numbers.
str.isprintable()
Return a string which is the concatenation of the strings in
*iterable*. A "TypeError" will be raised if there are any non-
string values in *iterable*, including "bytes" objects. The
- separator between elements is the string providing this method.
+ separator between elements is the string providing this method. For
+ example:
+
+ >>> ', '.join(['spam', 'spam', 'spam'])
+ 'spam, spam, spam'
+ >>> '-'.join('Python')
+ 'P-y-t-h-o-n'
+
+ See also "split()".
str.ljust(width, fillchar=' ', /)
space). The original string is returned if *width* is less than or
equal to "len(s)".
+ For example:
+
+ >>> 'Python'.ljust(10)
+ 'Python '
+ >>> 'Python'.ljust(10, '.')
+ 'Python....'
+ >>> 'Monty Python'.ljust(10, '.')
+ 'Monty Python'
+
+ See also "rjust()".
+
str.lower()
Return a copy of the string with all the cased characters [4]
>>> " foo ".split(maxsplit=0)
['foo ']
+ See also "join()".
+
str.splitlines(keepends=False)
Return a list of the lines in the string, breaking at line
Added in version 3.6.
-A *formatted string literal* or *f-string* is a string literal that is
-prefixed with ‘"f"’ or ‘"F"’. These strings may contain replacement
-fields, which are expressions delimited by curly braces "{}". While
-other string literals always have a constant value, formatted strings
-are really expressions evaluated at run time.
-
-Escape sequences are decoded like in ordinary string literals (except
-when a literal is also marked as a raw string). After decoding, the
-grammar for the contents of the string is:
-
- f_string: (literal_char | "{{" | "}}" | replacement_field)*
- replacement_field: "{" f_expression ["="] ["!" conversion] [":" format_spec] "}"
- f_expression: (conditional_expression | "*" or_expr)
- ("," conditional_expression | "," "*" or_expr)* [","]
- | yield_expression
- conversion: "s" | "r" | "a"
- format_spec: (literal_char | replacement_field)*
- literal_char: <any code point except "{", "}" or NULL>
-
-The parts of the string outside curly braces are treated literally,
-except that any doubled curly braces "'{{'" or "'}}'" are replaced
-with the corresponding single curly brace. A single opening curly
-bracket "'{'" marks a replacement field, which starts with a Python
-expression. To display both the expression text and its value after
-evaluation, (useful in debugging), an equal sign "'='" may be added
-after the expression. A conversion field, introduced by an exclamation
-point "'!'" may follow. A format specifier may also be appended,
-introduced by a colon "':'". A replacement field ends with a closing
-curly bracket "'}'".
-
-Expressions in formatted string literals are treated like regular
-Python expressions surrounded by parentheses, with a few exceptions.
-An empty expression is not allowed, and both "lambda" and assignment
-expressions ":=" must be surrounded by explicit parentheses. Each
-expression is evaluated in the context where the formatted string
-literal appears, in order from left to right. Replacement expressions
-can contain newlines in both single-quoted and triple-quoted f-strings
-and they can contain comments. Everything that comes after a "#"
-inside a replacement field is a comment (even closing braces and
-quotes). In that case, replacement fields must be closed in a
-different line.
-
- >>> f"abc{a # This is a comment }"
- ... + 3}"
- 'abc5'
-
-Changed in version 3.7: Prior to Python 3.7, an "await" expression and
-comprehensions containing an "async for" clause were illegal in the
-expressions in formatted string literals due to a problem with the
-implementation.
-
-Changed in version 3.12: Prior to Python 3.12, comments were not
-allowed inside f-string replacement fields.
+Changed in version 3.7: The "await" and "async for" can be used in
+expressions within f-strings.
-When the equal sign "'='" is provided, the output will have the
-expression text, the "'='" and the evaluated value. Spaces after the
-opening brace "'{'", within the expression and after the "'='" are all
-retained in the output. By default, the "'='" causes the "repr()" of
-the expression to be provided, unless there is a format specified.
-When a format is specified it defaults to the "str()" of the
-expression unless a conversion "'!r'" is declared.
+Changed in version 3.8: Added the debug specifier ("=")
-Added in version 3.8: The equal sign "'='".
+Changed in version 3.12: Many restrictions on expressions within
+f-strings have been removed. Notably, nested strings, comments, and
+backslashes are now permitted.
-If a conversion is specified, the result of evaluating the expression
-is converted before formatting. Conversion "'!s'" calls "str()" on
-the result, "'!r'" calls "repr()", and "'!a'" calls "ascii()".
+A *formatted string literal* or *f-string* is a string literal that is
+prefixed with ‘"f"’ or ‘"F"’. Unlike other string literals, f-strings
+do not have a constant value. They may contain *replacement fields*
+delimited by curly braces "{}". Replacement fields contain expressions
+which are evaluated at run time. For example:
+
+ >>> who = 'nobody'
+ >>> nationality = 'Spanish'
+ >>> f'{who.title()} expects the {nationality} Inquisition!'
+ 'Nobody expects the Spanish Inquisition!'
+
+Any doubled curly braces ("{{" or "}}") outside replacement fields are
+replaced with the corresponding single curly brace:
+
+ >>> print(f'{{...}}')
+ {...}
+
+Other characters outside replacement fields are treated like in
+ordinary string literals. This means that escape sequences are decoded
+(except when a literal is also marked as a raw string), and newlines
+are possible in triple-quoted f-strings:
+
+ >>> name = 'Galahad'
+ >>> favorite_color = 'blue'
+ >>> print(f'{name}:\\t{favorite_color}')
+ Galahad: blue
+ >>> print(rf"C:\\Users\\{name}")
+ C:\\Users\\Galahad
+ >>> print(f\'\'\'Three shall be the number of the counting
+ ... and the number of the counting shall be three.\'\'\')
+ Three shall be the number of the counting
+ and the number of the counting shall be three.
-The result is then formatted using the "format()" protocol. The
-format specifier is passed to the "__format__()" method of the
-expression or conversion result. An empty string is passed when the
-format specifier is omitted. The formatted result is then included in
-the final value of the whole string.
+Expressions in formatted string literals are treated like regular
+Python expressions. Each expression is evaluated in the context where
+the formatted string literal appears, in order from left to right. An
+empty expression is not allowed, and both "lambda" and assignment
+expressions ":=" must be surrounded by explicit parentheses:
-Top-level format specifiers may include nested replacement fields.
-These nested fields may include their own conversion fields and format
-specifiers, but may not include more deeply nested replacement fields.
-The format specifier mini-language is the same as that used by the
-"str.format()" method.
-
-Formatted string literals may be concatenated, but replacement fields
-cannot be split across literals.
-
-Some examples of formatted string literals:
-
- >>> name = "Fred"
- >>> f"He said his name is {name!r}."
- "He said his name is 'Fred'."
- >>> f"He said his name is {repr(name)}." # repr() is equivalent to !r
- "He said his name is 'Fred'."
- >>> width = 10
- >>> precision = 4
- >>> value = decimal.Decimal("12.34567")
- >>> f"result: {value:{width}.{precision}}" # nested fields
- 'result: 12.35'
- >>> today = datetime(year=2017, month=1, day=27)
- >>> f"{today:%B %d, %Y}" # using date format specifier
- 'January 27, 2017'
- >>> f"{today=:%B %d, %Y}" # using date format specifier and debugging
- 'today=January 27, 2017'
- >>> number = 1024
- >>> f"{number:#0x}" # using integer format specifier
- '0x400'
- >>> foo = "bar"
- >>> f"{ foo = }" # preserves whitespace
- " foo = 'bar'"
- >>> line = "The mill's closed"
- >>> f"{line = }"
- 'line = "The mill\\'s closed"'
- >>> f"{line = :20}"
- "line = The mill's closed "
- >>> f"{line = !r:20}"
- 'line = "The mill\\'s closed" '
+ >>> f'{(half := 1/2)}, {half * 42}'
+ '0.5, 21.0'
Reusing the outer f-string quoting type inside a replacement field is
permitted:
>>> f"abc {a["x"]} def"
'abc 2 def'
-Changed in version 3.12: Prior to Python 3.12, reuse of the same
-quoting type of the outer f-string inside a replacement field was not
-possible.
-
Backslashes are also allowed in replacement fields and are evaluated
the same way as in any other context:
b
c
-Changed in version 3.12: Prior to Python 3.12, backslashes were not
-permitted inside an f-string replacement field.
+It is possible to nest f-strings:
+
+ >>> name = 'world'
+ >>> f'Repeated:{f' hello {name}' * 3}'
+ 'Repeated: hello world hello world hello world'
+
+Portable Python programs should not use more than 5 levels of nesting.
+
+**CPython implementation detail:** CPython does not limit nesting of
+f-strings.
+
+Replacement expressions can contain newlines in both single-quoted and
+triple-quoted f-strings and they can contain comments. Everything that
+comes after a "#" inside a replacement field is a comment (even
+closing braces and quotes). This means that replacement fields with
+comments must be closed in a different line:
+
+ >>> a = 2
+ >>> f"abc{a # This comment }" continues until the end of the line
+ ... + 3}"
+ 'abc5'
+
+After the expression, replacement fields may optionally contain:
+
+* a *debug specifier* – an equal sign ("="), optionally surrounded by
+ whitespace on one or both sides;
+
+* a *conversion specifier* – "!s", "!r" or "!a"; and/or
+
+* a *format specifier* prefixed with a colon (":").
-Formatted string literals cannot be used as docstrings, even if they
-do not include expressions.
+See the Standard Library section on f-strings for details on how these
+fields are evaluated.
+
+As that section explains, *format specifiers* are passed as the second
+argument to the "format()" function to format a replacement field
+value. For example, they can be used to specify a field width and
+padding characters using the Format Specification Mini-Language:
+
+ >>> number = 14.3
+ >>> f'{number:20.7f}'
+ ' 14.3000000'
+
+Top-level format specifiers may include nested replacement fields:
+
+ >>> field_size = 20
+ >>> precision = 7
+ >>> f'{number:{field_size}.{precision}f}'
+ ' 14.3000000'
+
+These nested fields may include their own conversion fields and format
+specifiers:
+
+ >>> number = 3
+ >>> f'{number:{field_size}}'
+ ' 3'
+ >>> f'{number:{field_size:05}}'
+ '00000000000000000003'
+
+However, these nested fields may not include more deeply nested
+replacement fields.
+
+Formatted string literals cannot be used as *docstrings*, even if they
+do not include expressions:
>>> def foo():
... f"Not a docstring"
...
- >>> foo.__doc__ is None
- True
+ >>> print(foo.__doc__)
+ None
+
+See also:
-See also **PEP 498** for the proposal that added formatted string
-literals, and "str.format()", which uses a related format string
-mechanism.
+ * **PEP 498** – Literal String Interpolation
+
+ * **PEP 701** – Syntactic formalization of f-strings
+
+ * "str.format()", which uses a related format string mechanism.
t-strings
Added in version 3.14.
A *template string literal* or *t-string* is a string literal that is
-prefixed with ‘"t"’ or ‘"T"’. These strings follow the same syntax and
-evaluation rules as formatted string literals, with the following
-differences:
-
-* Rather than evaluating to a "str" object, template string literals
- evaluate to a "string.templatelib.Template" object.
-
-* The "format()" protocol is not used. Instead, the format specifier
- and conversions (if any) are passed to a new "Interpolation" object
- that is created for each evaluated expression. It is up to code that
- processes the resulting "Template" object to decide how to handle
- format specifiers and conversions.
-
-* Format specifiers containing nested replacement fields are evaluated
- eagerly, prior to being passed to the "Interpolation" object. For
- instance, an interpolation of the form "{amount:.{precision}f}" will
- evaluate the inner expression "{precision}" to determine the value
- of the "format_spec" attribute. If "precision" were to be "2", the
- resulting format specifier would be "'.2f'".
-
-* When the equals sign "'='" is provided in an interpolation
- expression, the text of the expression is appended to the literal
- string that precedes the relevant interpolation. This includes the
- equals sign and any surrounding whitespace. The "Interpolation"
- instance for the expression will be created as normal, except that
- "conversion" will be set to ‘"r"’ ("repr()") by default. If an
- explicit conversion or format specifier are provided, this will
- override the default behaviour.
+prefixed with ‘"t"’ or ‘"T"’. These strings follow the same syntax
+rules as formatted string literals. For differences in evaluation
+rules, see the Standard Library section on t-strings
+
+
+Formal grammar for f-strings
+============================
+
+F-strings are handled partly by the *lexical analyzer*, which produces
+the tokens "FSTRING_START", "FSTRING_MIDDLE" and "FSTRING_END", and
+partly by the parser, which handles expressions in the replacement
+field. The exact way the work is split is a CPython implementation
+detail.
+
+Correspondingly, the f-string grammar is a mix of lexical and
+syntactic definitions.
+
+Whitespace is significant in these situations:
+
+* There may be no whitespace in "FSTRING_START" (between the prefix
+ and quote).
+
+* Whitespace in "FSTRING_MIDDLE" is part of the literal string
+ contents.
+
+* In "fstring_replacement_field", if "f_debug_specifier" is present,
+ all whitespace after the opening brace until the
+ "f_debug_specifier", as well as whitespace immediately following
+ "f_debug_specifier", is retained as part of the expression.
+
+ **CPython implementation detail:** The expression is not handled in
+ the tokenization phase; it is retrieved from the source code using
+ locations of the "{" token and the token after "=".
+
+The "FSTRING_MIDDLE" definition uses negative lookaheads ("!") to
+indicate special characters (backslash, newline, "{", "}") and
+sequences ("f_quote").
+
+ fstring: FSTRING_START fstring_middle* FSTRING_END
+
+ FSTRING_START: fstringprefix ("'" | '"' | "\'\'\'" | '"""')
+ FSTRING_END: f_quote
+ fstringprefix: <("f" | "fr" | "rf"), case-insensitive>
+ f_debug_specifier: '='
+ f_quote: <the quote character(s) used in FSTRING_START>
+
+ fstring_middle:
+ | fstring_replacement_field
+ | FSTRING_MIDDLE
+ FSTRING_MIDDLE:
+ | (!"\\" !newline !'{' !'}' !f_quote) source_character
+ | stringescapeseq
+ | "{{"
+ | "}}"
+ | <newline, in triple-quoted f-strings only>
+ fstring_replacement_field:
+ | '{' f_expression [f_debug_specifier] [fstring_conversion]
+ [fstring_full_format_spec] '}'
+ fstring_conversion:
+ | "!" ("s" | "r" | "a")
+ fstring_full_format_spec:
+ | ':' fstring_format_spec*
+ fstring_format_spec:
+ | FSTRING_MIDDLE
+ | fstring_replacement_field
+ f_expression:
+ | ','.(conditional_expression | "*" or_expr)+ [","]
+ | yield_expression
+
+Note:
+
+ In the above grammar snippet, the "f_quote" and "FSTRING_MIDDLE"
+ rules are context-sensitive – they depend on the contents of
+ "FSTRING_START" of the nearest enclosing "fstring".Constructing a
+ more traditional formal grammar from this template is left as an
+ exercise for the reader.
+
+The grammar for t-strings is identical to the one for f-strings, with
+*t* instead of *f* at the beginning of rule and token names and in the
+prefix.
+
+ tstring: TSTRING_START tstring_middle* TSTRING_END
+
+ <rest of the t-string grammar is omitted; see above>
''',
'subscriptions': r'''Subscriptions
*************
... except* BlockingIOError as e:
... print(repr(e))
...
- ExceptionGroup('', (BlockingIOError()))
+ ExceptionGroup('', (BlockingIOError(),))
"break", "continue" and "return" cannot appear in an "except*" clause.
Sets
These represent a mutable set. They are created by the built-in
"set()" constructor and can be modified afterwards by several
- methods, such as "add".
+ methods, such as "add()".
Frozen sets
These represent an immutable set. They are created by the built-in
module.__file__
-module.__cached__
-
- "__file__" and "__cached__" are both optional attributes that may
- or may not be set. Both attributes should be a "str" when they are
- available.
-
- "__file__" indicates the pathname of the file from which the module
- was loaded (if loaded from a file), or the pathname of the shared
- library file for extension modules loaded dynamically from a shared
- library. It might be missing for certain types of modules, such as
- C modules that are statically linked into the interpreter, and the
- import system may opt to leave it unset if it has no semantic
- meaning (for example, a module loaded from a database).
-
- If "__file__" is set then the "__cached__" attribute might also be
- set, which is the path to any compiled version of the code (for
- example, a byte-compiled file). The file does not need to exist to
- set this attribute; the path can simply point to where the compiled
- file *would* exist (see **PEP 3147**).
-
- Note that "__cached__" may be set even if "__file__" is not set.
- However, that scenario is quite atypical. Ultimately, the *loader*
- is what makes use of the module spec provided by the *finder* (from
- which "__file__" and "__cached__" are derived). So if a loader can
- load from a cached module but otherwise does not load from a file,
- that atypical scenario may be appropriate.
+ "__file__" is an optional attribute that may or may not be set.
+ Both attributes should be a "str" when they are available.
- It is **strongly** recommended that you use
- "module.__spec__.cached" instead of "module.__cached__".
+ An optional attribute, "__file__" indicates the pathname of the
+ file from which the module was loaded (if loaded from a file), or
+ the pathname of the shared library file for extension modules
+ loaded dynamically from a shared library. It might be missing for
+ certain types of modules, such as C modules that are statically
+ linked into the interpreter, and the import system may opt to leave
+ it unset if it has no semantic meaning (for example, a module
+ loaded from a database).
Deprecated since version 3.13, removed in version 3.15: Setting
"__cached__" on a module while failing to set "__spec__.cached" is
deprecated. In Python 3.15, "__cached__" will cease to be set or
taken into consideration by the import system or standard library.
+ Changed in version 3.15: "__cached__" is no longer set.
+
Other writable attributes on module objects
-------------------------------------------
the keyword argument replaces the value from the positional
argument.
- Providing keyword arguments as in the first example only works for
- keys that are valid Python identifiers. Otherwise, any valid keys
- can be used.
-
Dictionaries compare equal if and only if they have the same "(key,
value)" pairs (regardless of ordering). Order comparisons (‘<’,
‘<=’, ‘>=’, ‘>’) raise "TypeError". To illustrate dictionary
--- /dev/null
+.. date: 2025-11-18-13-55-47
+.. gh-issue: 141692
+.. nonce: tud9if
+.. release date: 2025-12-16
+.. section: Tools/Demos
+
+Each slice of an iOS XCframework now contains a ``lib`` folder that contains
+a symlink to the libpython dylib. This allows binary modules to be compiled
+for iOS using dynamic libreary linking, rather than Framework linking.
+
+..
+
+.. date: 2025-10-27-15-53-47
+.. gh-issue: 140381
+.. nonce: N5o3pa
+.. section: Tests
+
+Fix flaky test_profiling tests on i686 and s390x architectures by increasing
+slow_fibonacci call frequency from every 5th iteration to every 2nd
+iteration.
+
+..
+
+.. date: 2025-10-16-15-08-58
+.. gh-issue: 140210
+.. nonce: P9vUP8
+.. section: Tests
+
+Make ``test_sysconfig.test_parse_makefile_renamed_vars`` less fragile by
+clearing the environment variables before parsing the Makefile.
+
+..
+
+.. date: 2025-12-01-09-36-45
+.. gh-issue: 142145
+.. nonce: tcAUhg
+.. section: Security
+
+Remove quadratic behavior in ``xml.minidom`` node ID cache clearing.
+
+..
+
+.. date: 2025-11-13-22-31-56
+.. gh-issue: 42400
+.. nonce: pqB5Kq
+.. section: Security
+
+Fix buffer overflow in ``_Py_wrealpath()`` for paths exceeding
+``MAXPATHLEN`` bytes by using dynamic memory allocation instead of
+fixed-size buffer. Patch by Shamil Abdulaev.
+
+..
+
+.. date: 2024-05-23-11-47-48
+.. gh-issue: 119451
+.. nonce: qkJe9-
+.. section: Security
+
+Fix a potential memory denial of service in the :mod:`http.client` module.
+When connecting to a malicious server, it could cause an arbitrary amount of
+memory to be allocated. This could have led to symptoms including a
+:exc:`MemoryError`, swapping, out of memory (OOM) killed processes or
+containers, or even system crashes.
+
+..
+
+.. date: 2024-05-21-22-11-31
+.. gh-issue: 119342
+.. nonce: BTFj4Z
+.. section: Security
+
+Fix a potential memory denial of service in the :mod:`plistlib` module. When
+reading a Plist file received from untrusted source, it could cause an
+arbitrary amount of memory to be allocated. This could have led to symptoms
+including a :exc:`MemoryError`, swapping, out of memory (OOM) killed
+processes or containers, or even system crashes.
+
+..
+
+.. date: 2025-12-16-11-55-55
+.. gh-issue: 142754
+.. nonce: xuCrt3
+.. section: Library
+
+Add the *ownerDocument* attribute to :mod:`xml.dom.minidom` elements and
+attributes created by directly instantiating the ``Element`` or ``Attr``
+class. Note that this way of creating nodes is not supported; creator
+functions like :py:meth:`xml.dom.Document.documentElement` should be used
+instead.
+
+..
+
+.. date: 2025-12-14-18-30-48
+.. gh-issue: 142594
+.. nonce: belDmD
+.. section: Library
+
+Fix crash in ``TextIOWrapper.close()`` when the underlying buffer's
+``closed`` property calls :meth:`~io.TextIOBase.detach`.
+
+..
+
+.. date: 2025-12-13-21-19-28
+.. gh-issue: 76007
+.. nonce: 6fs_gT
+.. section: Library
+
+Deprecate ``__version__`` from :mod:`ctypes`. Patch by Hugo van Kemenade.
+
+..
+
+.. date: 2025-12-13-19-17-01
+.. gh-issue: 76007
+.. nonce: -OSQU3
+.. section: Library
+
+Deprecate ``__version__`` from :mod:`wsgiref.simple_server`. Patch by Hugo
+van Kemenade.
+
+..
+
+.. date: 2025-12-13-06-17-44
+.. gh-issue: 142651
+.. nonce: ZRtBu4
+.. section: Library
+
+:mod:`unittest.mock`: fix a thread safety issue where :attr:`Mock.call_count
+<unittest.mock.Mock.call_count>` may return inaccurate values when the mock
+is called concurrently from multiple threads.
+
+..
+
+.. date: 2025-12-13-00-09-09
+.. gh-issue: 76007
+.. nonce: Xg1xCO
+.. section: Library
+
+Deprecate ``__version__`` from :mod:`http.server`. Patch by Hugo van
+Kemenade.
+
+..
+
+.. date: 2025-12-12-15-14-03
+.. gh-issue: 138122
+.. nonce: m3EF9E
+.. section: Library
+
+Add ``--subprocesses`` flag to :mod:`profiling.sampling` CLI to
+automatically profile subprocesses spawned by the target. When enabled, the
+profiler monitors for new Python subprocesses and profiles each one
+separately, writing results to individual output files. This is useful for
+profiling applications that use :mod:`multiprocessing`,
+:class:`~concurrent.futures.ProcessPoolExecutor`, or other subprocess-based
+parallelism. Patch by Pablo Galindo.
+
+..
+
+.. date: 2025-12-12-02-56-26
+.. gh-issue: 142595
+.. nonce: wHvTqq
+.. section: Library
+
+Added type check during initialization of the :mod:`decimal` module to
+prevent a crash in case of broken stdlib. Patch by Sergey B Kirpichev.
+
+..
+
+.. date: 2025-12-11-09-03-07
+.. gh-issue: 142556
+.. nonce: RuiBte
+.. section: Library
+
+Fix crash when a task gets re-registered during finalization in
+:mod:`asyncio`. Patch by Kumar Aditya.
+
+..
+
+.. date: 2025-12-11-04-18-49
+.. gh-issue: 138122
+.. nonce: m3EF9E
+.. section: Library
+
+Add ``--mode=exception`` to the sampling profiler to capture samples only
+from threads with an active exception, useful for analyzing exception
+handling overhead. Patch by Pablo Galindo.
+
+..
+
+.. date: 2025-12-10-21-19-10
+.. gh-issue: 142539
+.. nonce: _8Vzr0
+.. section: Library
+
+:mod:`traceback`: Fix location of carets in :exc:`SyntaxError`\s when the
+source contains wide characters.
+
+..
+
+.. date: 2025-12-10-11-20-05
+.. gh-issue: 123241
+.. nonce: oYg2n7
+.. section: Library
+
+Avoid reference count operations in garbage collection of :mod:`ctypes`
+objects.
+
+..
+
+.. date: 2025-12-10-11-02-53
+.. gh-issue: 142451
+.. nonce: eCLvhG
+.. section: Library
+
+:mod:`hmac`: correctly copy :class:`~hmac.HMAC` attributes for objects
+copied through :meth:`HMAC.copy() <hmac.HMAC.copy>`. Patch by Bénédikt Tran.
+
+..
+
+.. date: 2025-12-09-22-11-59
+.. gh-issue: 138122
+.. nonce: CsoBEo
+.. section: Library
+
+The ``profiling.sampling`` flamegraph profiler now supports inverted
+flamegraph view that aggregates all leaf nodes. In a standard flamegraph, if
+a hot function is called from multiple locations, it appears multiple times
+as separate leaf nodes. In the inverted flamegraph, all occurrences of the
+same leaf function are merged into a single aggregated node at the root,
+showing the total hotness of that function in one place. The children of
+each aggregated node represent its callers, making it easier to identify
+which functions consume the most CPU time and where they are called from.
+
+..
+
+.. date: 2025-12-09-14-40-45
+.. gh-issue: 112527
+.. nonce: Tvf5Zk
+.. section: Library
+
+The help text for required options in :mod:`argparse` no longer extended
+with " (default: None)".
+
+..
+
+.. date: 2025-12-08-18-12-44
+.. gh-issue: 142438
+.. nonce: UF_0nd
+.. section: Library
+
+Fixed a possible leaked GIL in _PySSL_keylog_callback.
+
+..
+
+.. date: 2025-12-07-23-21-13
+.. gh-issue: 138122
+.. nonce: m3EF9E
+.. section: Library
+
+Add bytecode-level instruction profiling to the sampling profiler via the
+new ``--opcodes`` flag. When enabled, the profiler captures which bytecode
+opcode is executing at each sample, including Python 3.11+ adaptive
+specializations, and visualizes this data in the heatmap, flamegraph, gecko,
+and live output formats. Patch by Pablo Galindo
+
+..
+
+.. date: 2025-12-07-22-13-28
+.. gh-issue: 142389
+.. nonce: J9v904
+.. section: Library
+
+Add backtick markup support in :mod:`argparse` description and epilog text
+to highlight inline code when color output is enabled.
+
+..
+
+.. date: 2025-12-07-17-30-05
+.. gh-issue: 142346
+.. nonce: okcAAp
+.. section: Library
+
+Fix usage formatting for mutually exclusive groups in :mod:`argparse` when
+they are preceded by positional arguments or followed or intermixed with
+other optional arguments.
+
+..
+
+.. date: 2025-12-07-13-37-18
+.. gh-issue: 142374
+.. nonce: m3EF9E
+.. section: Library
+
+Fix cumulative percentage calculation for recursive functions in the new
+sampling profiler. When profiling recursive functions, cumulative statistics
+(cumul%, cumtime) could exceed 100% because each recursive frame in a stack
+was counted separately. For example, a function recursing 500 times in every
+sample would show 50000% cumulative presence. The fix deduplicates locations
+within each sample so cumulative stats correctly represent "percentage of
+samples where this function was on the stack". Patch by Pablo Galindo.
+
+..
+
+.. date: 2025-12-07-02-36-24
+.. gh-issue: 142315
+.. nonce: 02o5E_
+.. section: Library
+
+Pdb can now run scripts from anonymous pipes used in process substitution.
+Patch by Bartosz Sławecki.
+
+..
+
+.. date: 2025-12-06-16-45-34
+.. gh-issue: 64532
+.. nonce: 4OXZpF
+.. section: Library
+
+Subparser help now includes required optional arguments from the parent
+parser in the usage, making it clearer what arguments are needed to run a
+subcommand. Patch by Savannah Ostrowski.
+
+..
+
+.. date: 2025-12-06-13-19-43
+.. gh-issue: 142207
+.. nonce: x_X9oH
+.. section: Library
+
+Fix: profiling.sampling may cause assertion ``!(has_gil && gil_requested)``
+
+..
+
+.. date: 2025-12-06-13-02-13
+.. gh-issue: 142332
+.. nonce: PNvXCV
+.. section: Library
+
+Fix usage formatting for positional arguments in mutually exclusive groups
+in :mod:`argparse`. in :mod:`argparse`.
+
+..
+
+.. date: 2025-12-05-18-26-50
+.. gh-issue: 142282
+.. nonce: g6RQUN
+.. section: Library
+
+Fix :func:`winreg.QueryValueEx` to not accidentally read garbage buffer
+under race condition.
+
+..
+
+.. date: 2025-12-05-18-25-29
+.. gh-issue: 142318
+.. nonce: EzcQ3N
+.. section: Library
+
+Fix typing ``'q'`` at the help of the interactive tachyon profiler exiting
+the profiler.
+
+..
+
+.. date: 2025-12-05-16-39-17
+.. gh-issue: 75949
+.. nonce: pHxW98
+.. section: Library
+
+Fix :mod:`argparse` to preserve ``|`` separators in mutually exclusive
+groups when the usage line wraps due to length.
+
+..
+
+.. date: 2025-12-04-23-26-12
+.. gh-issue: 142267
+.. nonce: yOM6fP
+.. section: Library
+
+Improve :mod:`argparse` performance by caching the formatter used for
+argument validation.
+
+..
+
+.. date: 2025-12-04-23-24-24
+.. gh-issue: 139862
+.. nonce: NBfsD4
+.. section: Library
+
+Remove ``color`` parameter from :class:`!argparse.HelpFormatter`
+constructor. Color is controlled by :class:`~argparse.ArgumentParser`.
+
+..
+
+.. date: 2025-12-04-09-22-31
+.. gh-issue: 68552
+.. nonce: I_v-xB
+.. section: Library
+
+``MisplacedEnvelopeHeaderDefect`` and ``Missing header name`` defects are
+now correctly passed to the ``handle_defect`` method of ``policy`` in
+:class:`~email.parser.FeedParser`.
+
+..
+
+.. date: 2025-12-03-09-36-29
+.. gh-issue: 142206
+.. nonce: ilwegH
+.. section: Library
+
+The resource tracker in the :mod:`multiprocessing` module can now understand
+messages from older versions of itself. This avoids issues with upgrading
+Python while it is running. (Note that such 'in-place' upgrades are not
+tested.)
+
+..
+
+.. date: 2025-12-03-06-12-39
+.. gh-issue: 142214
+.. nonce: appYNZ
+.. section: Library
+
+Fix two regressions in :mod:`dataclasses` in Python 3.14.1 related to
+annotations.
+
+* An exception is no longer raised if ``slots=True`` is used and the
+ ``__init__`` method does not have an ``__annotate__`` attribute
+ (likely because ``init=False`` was used).
+
+* An exception is no longer raised if annotations are requested on the
+ ``__init__`` method and one of the fields is not present in the class
+ annotations. This can occur in certain dynamic scenarios.
+
+Patch by Jelle Zijlstra.
+
+..
+
+.. date: 2025-12-02-14-52-51
+.. gh-issue: 142203
+.. nonce: ofWOvV
+.. section: Library
+
+Remove the *debug_override* parameter from
+:func:`importlib.util.cache_from_source` which has been deprecated since
+Python 3.5.
+
+..
+
+.. date: 2025-12-01-14-43-58
+.. gh-issue: 138122
+.. nonce: nRm3ic
+.. section: Library
+
+The ``_remote_debugging`` module now implements frame caching in the
+``RemoteUnwinder`` class to reduce memory reads when profiling remote
+processes. When ``cache_frames=True``, unchanged portions of the call stack
+are reused from previous samples, significantly improving profiling
+performance for deep call stacks.
+
+..
+
+.. date: 2025-12-01-10-03-08
+.. gh-issue: 116738
+.. nonce: 972YsG
+.. section: Library
+
+Fix :mod:`cmath` data race when initializing trigonometric tables with
+subinterpreters.
+
+..
+
+.. date: 2025-11-30-04-28-30
+.. gh-issue: 141982
+.. nonce: pxZct9
+.. section: Library
+
+Allow :mod:`pdb` to set breakpoints on async functions with function names.
+
+..
+
+.. date: 2025-11-29-04-20-44
+.. gh-issue: 74389
+.. nonce: pW3URj
+.. section: Library
+
+When the stdin being used by a :class:`subprocess.Popen` instance is closed,
+this is now ignored in :meth:`subprocess.Popen.communicate` instead of
+leaving the class in an inconsistent state.
+
+..
+
+.. date: 2025-11-29-03-02-45
+.. gh-issue: 87512
+.. nonce: bn4xbm
+.. section: Library
+
+Fix :func:`subprocess.Popen.communicate` timeout handling on Windows when
+writing large input. Previously, the timeout was ignored during stdin
+writing, causing the method to block indefinitely if the child process did
+not consume input quickly. The stdin write is now performed in a background
+thread, allowing the timeout to be properly enforced.
+
+..
+
+.. date: 2025-11-28-08-25-19
+.. gh-issue: 141939
+.. nonce: BXPnFj
+.. section: Library
+
+Add color to all interpolated values in :mod:`argparse` help, like
+``%(default)s`` or ``%(choices)s``. Patch by Alex Prengère.
+
+..
+
+.. date: 2025-11-27-20-16-38
+.. gh-issue: 141473
+.. nonce: Wq4xVN
+.. section: Library
+
+When :meth:`subprocess.Popen.communicate` was called with *input* and a
+*timeout* and is called for a second time after a
+:exc:`~subprocess.TimeoutExpired` exception before the process has died, it
+should no longer hang.
+
+..
+
+.. date: 2025-11-27-11-39-50
+.. gh-issue: 141999
+.. nonce: _FKGlu
+.. section: Library
+
+Correctly allow :exc:`KeyboardInterrupt` to stop the process when using
+:mod:`!profiling.sampling`.
+
+..
+
+.. date: 2025-11-27-10-49-13
+.. gh-issue: 142006
+.. nonce: nzJDG5
+.. section: Library
+
+Fix a bug in the :mod:`email.policy.default` folding algorithm which
+incorrectly resulted in a doubled newline when a line ending at exactly
+max_line_length was followed by an unfoldable token.
+
+..
+
+.. date: 2025-11-26-14-20-10
+.. gh-issue: 141968
+.. nonce: W139Pv
+.. section: Library
+
+Remove data copy from :mod:`re` compilation of regexes with large charsets
+by using :meth:`bytearray.take_bytes`.
+
+..
+
+.. date: 2025-11-25-23-35-07
+.. gh-issue: 141968
+.. nonce: b3Gscp
+.. section: Library
+
+Remove data copy from :mod:`encodings.idna` :meth:`~codecs.Codec.encode` and
+:meth:`~codecs.IncrementalEncoder.encode` by using
+:meth:`bytearray.take_bytes`.
+
+..
+
+.. date: 2025-11-25-23-29-08
+.. gh-issue: 141968
+.. nonce: 0JnjXf
+.. section: Library
+
+Remove data copy from :mod:`codecs` ``punycode`` encoding by using
+:meth:`bytearray.take_bytes`.
+
+..
+
+.. date: 2025-11-25-23-22-46
+.. gh-issue: 141968
+.. nonce: R1sHnJ
+.. section: Library
+
+Remove data copy from :func:`wave.Wave_read.readframes` and
+:func:`wave.Wave_write.writeframes` by using :meth:`bytearray.take_bytes`.
+
+..
+
+.. date: 2025-11-25-22-54-07
+.. gh-issue: 141968
+.. nonce: vg3AMJ
+.. section: Library
+
+Remove a data copy from :func:`base64.b32decode` and
+:func:`base64.b32encode` by using :meth:`bytearray.take_bytes`.
+
+..
+
+.. date: 2025-11-25-16-00-29
+.. gh-issue: 59000
+.. nonce: YtOyJy
+.. section: Library
+
+Fix :mod:`pdb` breakpoint resolution for class methods when the module
+defining the class is not imported.
+
+..
+
+.. date: 2025-11-25-13-13-34
+.. gh-issue: 116738
+.. nonce: MnZRdV
+.. section: Library
+
+Fix thread safety issue with :mod:`re` scanner objects in free-threaded
+builds.
+
+..
+
+.. date: 2025-11-24-14-05-52
+.. gh-issue: 138122
+.. nonce: 2bbGA8
+.. section: Library
+
+The ``profiling.sampling`` flamegraph profiler now displays thread status
+statistics showing the percentage of time threads spend holding the GIL,
+running without the GIL, waiting for the GIL, and performing garbage
+collection. These statistics help identify GIL contention and thread
+behavior patterns. When filtering by thread, the display shows per-thread
+metrics.
+
+..
+
+.. date: 2025-11-24-06-44-45
+.. gh-issue: 141781
+.. nonce: MsK27r
+.. section: Library
+
+Fixed an issue where pdb.line_prefix assignment was ignored if assigned
+after the module was imported.
+
+..
+
+.. date: 2025-11-22-16-33-48
+.. gh-issue: 141863
+.. nonce: 4PLhnv
+.. section: Library
+
+Update :ref:`asyncio-streams` to use :meth:`bytearray.take_bytes` for a over
+10% performance improvement on pyperformance asyncio_tcp benchmark.
+
+..
+
+.. date: 2025-11-21-21-14-10
+.. gh-issue: 141817
+.. nonce: _v5LdB
+.. section: Library
+
+Add :data:`!socket.IPV6_HDRINCL` constant.
+
+..
+
+.. date: 2025-11-18-15-48-13
+.. gh-issue: 105836
+.. nonce: sbUw24
+.. section: Library
+
+Fix :meth:`asyncio.run_coroutine_threadsafe` leaving underlying cancelled
+asyncio task running.
+
+..
+
+.. date: 2025-11-18-14-39-31
+.. gh-issue: 141570
+.. nonce: q3n984
+.. section: Library
+
+Support :term:`file-like object` raising :exc:`OSError` from
+:meth:`~io.IOBase.fileno` in color detection (``_colorize.can_colorize()``).
+This can occur when ``sys.stdout`` is redirected.
+
+..
+
+.. date: 2025-11-17-21-41-58
+.. gh-issue: 141679
+.. nonce: fs7zLJ
+.. section: Library
+
+Add colour to defaults in :mod:`argparse` help. Patch by Hugo van Kemenade.
+
+..
+
+.. date: 2025-11-17-16-53-49
+.. gh-issue: 141686
+.. nonce: V-xaoI
+.. section: Library
+
+Break reference cycles created by each call to :func:`json.dump` or
+:meth:`json.JSONEncoder.iterencode`.
+
+..
+
+.. date: 2025-11-17-08-16-30
+.. gh-issue: 141659
+.. nonce: QNi9Aj
+.. section: Library
+
+Fix bad file descriptor errors from ``_posixsubprocess`` on AIX.
+
+..
+
+.. date: 2025-11-17-00-53-51
+.. gh-issue: 141645
+.. nonce: TC3TL3
+.. section: Library
+
+Add a new ``--live`` mode to the tachyon profiler in
+:mod:`!profiling.sampling` module. This mode consist of a live TUI that
+displays real-time profiling statistics as the target application runs,
+similar to ``top``. Patch by Pablo Galindo
+
+..
+
+.. date: 2025-11-16-06-08-46
+.. gh-issue: 141615
+.. nonce: --6EK3
+.. section: Library
+
+Check ``stdin`` instead of ``stdout`` for ``use_rawinput`` in :mod:`pdb`.
+
+..
+
+.. date: 2025-11-16-04-40-06
+.. gh-issue: 69113
+.. nonce: Xy7Fmn
+.. section: Library
+
+Fix :mod:`doctest` to correctly report line numbers for doctests in
+``__test__`` dictionary when formatted as triple-quoted strings by finding
+unique lines in the string and matching them in the source file.
+
+..
+
+.. date: 2025-11-15-14-58-12
+.. gh-issue: 141600
+.. nonce: XY2BXg
+.. section: Library
+
+Fix musl version detection on Void Linux.
+
+..
+
+.. date: 2025-11-15-11-10-16
+.. gh-issue: 48752
+.. nonce: aB3xYz
+.. section: Library
+
+Add :func:`readline.get_pre_input_hook` function to retrieve the current
+pre-input hook. This allows applications to save and restore the hook
+without overwriting user settings. Patch by Sanyam Khurana.
+
+..
+
+.. date: 2025-11-14-18-00-41
+.. gh-issue: 141565
+.. nonce: Ap2bhJ
+.. section: Library
+
+Add async-aware profiling to the Tachyon sampling profiler. The profiler now
+reconstructs and displays async task hierarchies in flamegraphs, making the
+output more actionable for users. Patch by Savannah Ostrowski and Pablo
+Galindo Salgado.
+
+..
+
+.. date: 2025-11-13-13-11-02
+.. gh-issue: 60107
+.. nonce: LZq3QF
+.. section: Library
+
+Remove a copy from :meth:`io.RawIOBase.read`. If the underlying I/O class
+keeps a reference to the mutable memory, raise a :exc:`BufferError`.
+
+..
+
+.. date: 2025-11-10-00-14-20
+.. gh-issue: 116738
+.. nonce: IxliC_
+.. section: Library
+
+Make csv module thread-safe on the :term:`free threaded <free threading>`
+build.
+
+..
+
+.. date: 2025-11-03-17-13-00
+.. gh-issue: 140911
+.. nonce: 7KFvSQ
+.. section: Library
+
+:mod:`collections`: Ensure that the methods ``UserString.rindex()`` and
+``UserString.index()`` accept :class:`collections.UserString` instances as
+the sub argument.
+
+..
+
+.. date: 2025-11-02-10-44-23
+.. gh-issue: 140875
+.. nonce: wt6B37
+.. section: Library
+
+Fix handling of unclosed character references (named and numerical) followed
+by the end of file in :class:`html.parser.HTMLParser` with
+``convert_charrefs=False``.
+
+..
+
+.. date: 2025-10-27-17-00-11
+.. gh-issue: 140677
+.. nonce: hM9pTq
+.. section: Library
+
+Add heatmap visualization mode to the Tachyon sampling profiler. The new
+``--heatmap`` output format provides a line-by-line view showing execution
+intensity with color-coded samples, inline statistics, and interactive call
+graph navigation between callers and callees.
+
+..
+
+.. date: 2025-10-23-06-38-35
+.. gh-issue: 139946
+.. nonce: HZa5hu
+.. section: Library
+
+Distinguish stdout and stderr when colorizing output in argparse module.
+
+..
+
+.. date: 2025-10-12-12-43-56
+.. gh-issue: 76007
+.. nonce: PyGM14
+.. section: Library
+
+:mod:`pydoc`: Fix :exc:`DeprecationWarning` being raised when generating doc
+for :term:`stdlib` modules.
+
+..
+
+.. date: 2025-10-09-15-46-18
+.. gh-issue: 139686
+.. nonce: XwIZB2
+.. section: Library
+
+Make importlib.reload no-op for lazy modules.
+
+..
+
+.. date: 2025-09-09-13-00-42
+.. gh-issue: 138697
+.. nonce: QVwJw_
+.. section: Library
+
+Fix inferring *dest* from a single-dash long option in :mod:`argparse`. If a
+short option and a single-dash long option are passed to
+:meth:`!add_argument`, *dest* is now inferred from the single-dash long
+option.
+
+..
+
+.. date: 2025-09-09-10-13-24
+.. gh-issue: 138525
+.. nonce: hDTaAM
+.. section: Library
+
+Add support for single-dash long options and alternate prefix characters in
+:class:`argparse.BooleanOptionalAction`.
+
+..
+
+.. date: 2025-07-29-11-37-22
+.. gh-issue: 79986
+.. nonce: fnJbE_
+.. section: Library
+
+Add parsing for ``References`` and ``In-Reply-To`` headers to the
+:mod:`email` library that parses the header content as lists of message id
+tokens. This prevents them from being folded incorrectly.
+
+..
+
+.. date: 2025-07-10-18-40-11
+.. gh-issue: 135559
+.. nonce: BMDtYn
+.. section: Library
+
+Flag: a ``dir()`` on a ``Flag`` enumeration now shows non-canonical members.
+(i.e. aliases).
+
+..
+
+.. date: 2025-05-30-18-37-44
+.. gh-issue: 134453
+.. nonce: kxkA-o
+.. section: Library
+
+Fixed :func:`subprocess.Popen.communicate` ``input=`` handling of
+:class:`memoryview` instances that were non-byte shaped on POSIX platforms.
+Those are now properly cast to a byte shaped view instead of truncating the
+input. Windows platforms did not have this bug.
+
+..
+
+.. date: 2024-12-14-19-51-39
+.. gh-issue: 127930
+.. nonce: WsGnh9
+.. section: Library
+
+Add ``__all__`` to :mod:`tkinter.simpledialog`.
+
+..
+
+.. date: 2024-05-20-12-35-52
+.. gh-issue: 115952
+.. nonce: J6n_Kf
+.. section: Library
+
+Fix a potential memory denial of service in the :mod:`pickle` module. When
+reading a pickled data received from untrusted source, it could cause an
+arbitrary amount of memory to be allocated, even if the code that is allowed
+to execute is restricted by overriding the
+:meth:`~pickle.Unpickler.find_class` method. This could have led to symptoms
+including a :exc:`MemoryError`, swapping, out of memory (OOM) killed
+processes or containers, or even system crashes.
+
+..
+
+.. bpo: 40350
+.. date: 2021-10-23-22-12-13
+.. nonce: t0dQMY
+.. section: Library
+
+Fix support for namespace packages in :mod:`modulefinder`.
+
+..
+
+.. date: 2025-11-26-23-30-09
+.. gh-issue: 141994
+.. nonce: arBEG6
+.. section: Documentation
+
+:mod:`xml.sax.handler`: Make Documentation of
+:data:`xml.sax.handler.feature_external_ges` warn of opening up to `external
+entity attacks <https://en.wikipedia.org/wiki/XML_external_entity_attack>`_.
+Patch by Sebastian Pipping.
+
+..
+
+.. date: 2025-12-16-01-17-21
+.. gh-issue: 134584
+.. nonce: tsxYYw
+.. section: Core and Builtins
+
+Eliminate redundant refcounting from ``_STORE_ATTR_INSTANCE_VALUE``.
+
+..
+
+.. date: 2025-12-15-15-07-40
+.. gh-issue: 142718
+.. nonce: zjiGjS
+.. section: Core and Builtins
+
+JIT: Fix segfault caused by not flushing the stack to memory at side exits.
+
+..
+
+.. date: 2025-12-15-15-01-21
+.. gh-issue: 142737
+.. nonce: xYXzeB
+.. section: Core and Builtins
+
+Tracebacks will be displayed in fallback mode even if :func:`io.open` is
+lost. Previously, this would crash the interpreter. Patch by Bartosz
+Sławecki.
+
+..
+
+.. date: 2025-12-15-03-20-24
+.. gh-issue: 116738
+.. nonce: NNHiTK
+.. section: Core and Builtins
+
+Make the attributes in :mod:`bz2` thread-safe on the :term:`free threaded
+<free threading>` build.
+
+..
+
+.. date: 2025-12-14-21-46-07
+.. gh-issue: 134584
+.. nonce: vyec2h
+.. section: Core and Builtins
+
+Eliminate redundant refcounting from ``_CALL_LIST_APPEND``.
+
+..
+
+.. date: 2025-12-13-17-20-38
+.. gh-issue: 142554
+.. nonce: wNtEFF
+.. section: Core and Builtins
+
+Fix a crash in :func:`divmod` when :func:`!_pylong.int_divmod` does not
+return a tuple of length two exactly. Patch by Bénédikt Tran.
+
+..
+
+.. date: 2025-12-10-23-03-10
+.. gh-issue: 142531
+.. nonce: NUEa1T
+.. section: Core and Builtins
+
+Fix a free-threaded GC performance regression. If there are many untracked
+tuples, the GC will run too often, resulting in poor performance. The fix
+is to include untracked tuples in the "long lived" object count. The number
+of frozen objects is also now included since the free-threaded GC must scan
+those too.
+
+..
+
+.. date: 2025-12-08-17-34-57
+.. gh-issue: 142402
+.. nonce: iV0ON3
+.. section: Core and Builtins
+
+Fix reference counting when adjacent literal parts are merged while
+constructing :class:`string.templatelib.Template`, preventing the displaced
+string object from leaking.
+
+..
+
+.. date: 2025-12-08-14-14-40
+.. gh-issue: 116738
+.. nonce: x7aaBF
+.. section: Core and Builtins
+
+Make the attributes in :mod:`zlib` thread-safe on the :term:`free threaded
+<free threading>` build.
+
+..
+
+.. date: 2025-12-08-13-04-37
+.. gh-issue: 142343
+.. nonce: BTAyML
+.. section: Core and Builtins
+
+Fix SIGILL crash on m68k due to incorrect assembly constraint.
+
+..
+
+.. date: 2025-12-06-00-38-37
+.. gh-issue: 142236
+.. nonce: m3EF9E
+.. section: Core and Builtins
+
+Improve the "Perhaps you forgot a comma?" syntax error for multi-line string
+concatenations to point to the last string instead of the first, making it
+easier to locate where the comma is missing. Patch by Pablo Galindo.
+
+..
+
+.. date: 2025-12-06-00-16-43
+.. gh-issue: 142236
+.. nonce: m3EF9E
+.. section: Core and Builtins
+
+Fix incorrect keyword suggestions for syntax errors in :mod:`traceback`. The
+keyword typo suggestion mechanism would incorrectly suggest replacements
+when the extracted source code was incomplete rather than containing an
+actual typo. Patch by Pablo Galindo.
+
+..
+
+.. date: 2025-12-05-17-24-34
+.. gh-issue: 142305
+.. nonce: ybXvtr
+.. section: Core and Builtins
+
+Decrease the size of the generated stencils and the runtime JIT code. Patch
+by Diego Russo.
+
+..
+
+.. date: 2025-12-05-15-59-03
+.. gh-issue: 135379
+.. nonce: lDXbKO
+.. section: Core and Builtins
+
+Implement a limited form of register allocation known as "top of stack
+caching" in the JIT. It works by keeping 0-3 of the top items in the stack
+in registers. The code generator generates multiple versions of those uops
+that do not escape and are relatively small. During JIT compilation, the
+copy that produces the least memory traffic is selected, spilling or
+reloading values when needed.
+
+..
+
+.. date: 2025-12-05-14-33-54
+.. gh-issue: 142276
+.. nonce: H4j8hP
+.. section: Core and Builtins
+
+Fix missing type watcher when promoting attribute loads to constants in the
+JIT. Patch by Ken Jin. Reproducer by Yuancheng Jiang.
+
+..
+
+.. date: 2025-12-03-11-03-35
+.. gh-issue: 142218
+.. nonce: 44Fq_J
+.. section: Core and Builtins
+
+Fix crash when inserting into a split table dictionary with a non
+:class:`str` key that matches an existing key.
+
+..
+
+.. date: 2025-12-02-21-11-46
+.. gh-issue: 141976
+.. nonce: yu7pDV
+.. section: Core and Builtins
+
+Check against abstract stack overflow in the JIT optimizer.
+
+..
+
+.. date: 2025-12-02-15-39-16
+.. gh-issue: 97850
+.. nonce: H6QKwl
+.. section: Core and Builtins
+
+Remove all ``*.load_module()`` usage and definitions from the import system
+and importlib. The method has been deprecated in favor of
+``importlib.abc.Loader.exec_module()`` since Python 3.4.
+
+..
+
+.. date: 2025-12-01-20-41-26
+.. gh-issue: 142048
+.. nonce: c2YosX
+.. section: Core and Builtins
+
+Fix quadratically increasing garbage collection delays in free-threaded
+build.
+
+..
+
+.. date: 2025-12-01-15-22-54
+.. gh-issue: 65961
+.. nonce: hCJvRB
+.. section: Core and Builtins
+
+Stop setting ``__cached__`` on modules.
+
+..
+
+.. date: 2025-11-29-18-14-28
+.. gh-issue: 141770
+.. nonce: JURnvg
+.. section: Core and Builtins
+
+Annotate anonymous mmap usage only when supported by the Linux kernel and if
+``-X dev`` is used or Python is built in debug mode. Patch by Donghee Na.
+
+..
+
+.. date: 2025-11-29-08-51-56
+.. gh-issue: 142029
+.. nonce: rUpcmt
+.. section: Core and Builtins
+
+Raise :exc:`ModuleNotFoundError` instead of crashing when a nonexistent
+module is used as a name in ``_imp.create_builtin()``.
+
+..
+
+.. date: 2025-11-28-16-45-07
+.. gh-issue: 142029
+.. nonce: JuXiKu
+.. section: Core and Builtins
+
+Raise :exc:`ValueError` instead of crashing when empty string is used as a
+name in ``_imp.create_builtin()``.
+
+..
+
+.. date: 2025-11-26-20-01-07
+.. gh-issue: 141976
+.. nonce: K8NDmR
+.. section: Core and Builtins
+
+Protect against specialization failures in the tracing JIT compiler for
+performance reasons.
+
+..
+
+.. date: 2025-11-25-02-23-31
+.. gh-issue: 141861
+.. nonce: QcMdcM
+.. section: Core and Builtins
+
+Fix invalid memory read in the ``ENTER_EXECUTOR`` instruction.
+
+..
+
+.. date: 2025-11-24-21-09-30
+.. gh-issue: 141930
+.. nonce: hIIzSd
+.. section: Core and Builtins
+
+When importing a module, use Python's regular file object to ensure that
+writes to ``.pyc`` files are complete or an appropriate error is raised.
+
+..
+
+.. date: 2025-11-24-16-07-57
+.. gh-issue: 138122
+.. nonce: m3EF9E
+.. section: Core and Builtins
+
+Add incomplete sample detection to prevent corrupted profiling data. Each
+thread state now contains an embedded base frame (sentinel at the bottom of
+the frame stack) with owner type ``FRAME_OWNED_BY_INTERPRETER``. The
+profiler validates that stack unwinding terminates at this sentinel frame.
+Samples that fail to reach the base frame (due to race conditions, memory
+corruption, or other errors) are now rejected rather than being included as
+spurious data.
+
+..
+
+.. date: 2025-11-22-10-43-26
+.. gh-issue: 120158
+.. nonce: 41_rXd
+.. section: Core and Builtins
+
+Fix inconsistent state when enabling or disabling monitoring events too many
+times.
+
+..
+
+.. date: 2025-11-20-22-09-22
+.. gh-issue: 140638
+.. nonce: f6btj0
+.. section: Core and Builtins
+
+Expose a ``"candidates"`` stat in :func:`gc.get_stats` and
+:data:`gc.callbacks`.
+
+..
+
+.. date: 2025-11-20-13-18-57
+.. gh-issue: 141780
+.. nonce: xDrVNr
+.. section: Core and Builtins
+
+Fix :c:macro:`Py_mod_gil` with API added in :pep:`793`:
+:c:func:`!PyModule_FromSlotsAndSpec` and ``PyModExport`` hooks
+
+..
+
+.. date: 2025-11-19-16-40-24
+.. gh-issue: 141732
+.. nonce: PTetqp
+.. section: Core and Builtins
+
+Ensure the :meth:`~object.__repr__` for :exc:`ExceptionGroup` and
+:exc:`BaseExceptionGroup` does not change when the exception sequence that
+was original passed in to its constructor is subsequently mutated.
+
+..
+
+.. date: 2025-11-18-07-45-37
+.. gh-issue: 140638
+.. nonce: i06qxD
+.. section: Core and Builtins
+
+Expose a ``"duration"`` stat in :func:`gc.get_stats` and
+:data:`gc.callbacks`.
+
+..
+
+.. date: 2025-11-17-14-40-45
+.. gh-issue: 139653
+.. nonce: LzOy1M
+.. section: Core and Builtins
+
+Only raise a ``RecursionError`` or trigger a fatal error if the stack
+pointer is both below the limit pointer *and* above the stack base. If
+outside of these bounds assume that it is OK. This prevents false positives
+when user-space threads swap stacks.
+
+..
+
+.. date: 2025-11-16-21-14-48
+.. gh-issue: 41779
+.. nonce: rXIj5h
+.. section: Core and Builtins
+
+Allowed defining the *__dict__* and *__weakref__* :ref:`__slots__ <slots>`
+for any class.
+
+..
+
+.. date: 2025-11-15-23-58-23
+.. gh-issue: 139103
+.. nonce: 9cVYJ0
+.. section: Core and Builtins
+
+Improve multithreaded scaling of dataclasses on the free-threaded build.
+
+..
+
+.. date: 2025-11-15-14-04-35
+.. gh-issue: 141589
+.. nonce: VfdMDD
+.. section: Core and Builtins
+
+Change ``backoff counter`` to use prime numbers instead of powers of 2. Use
+only 3 bits for ``counter`` and 13 bits for ``value``. This allows to
+support values up to 8191. Patch by Mikhail Efimov.
+
+..
+
+.. date: 2025-07-22-16-20-06
+.. gh-issue: 137007
+.. nonce: 1oPvvK
+.. section: Core and Builtins
+
+Fix a bug during JIT compilation failure which caused garbage collection
+debug assertions to fail.
+
+..
+
+.. date: 2025-07-11-19-57-27
+.. gh-issue: 132657
+.. nonce: vwDuO2
+.. section: Core and Builtins
+
+For the free-threaded build, avoid locking the :class:`set` object for the
+``__contains__`` method.
+
+..
+
+.. date: 2025-06-28-17-54-27
+.. gh-issue: 134584
+.. nonce: EXgPub
+.. section: Core and Builtins
+
+Eliminate redundant refcounting from ``_CALL_STR_1``.
+
+..
+
+.. date: 2025-06-28-04-32-38
+.. gh-issue: 134584
+.. nonce: eZogqn
+.. section: Core and Builtins
+
+Eliminate redundant refcounting from ``_CALL_BUILTIN_O``.
+
+..
+
+.. date: 2025-06-23-22-52-20
+.. gh-issue: 134584
+.. nonce: qbiQfG
+.. section: Core and Builtins
+
+Eliminate redundant refcounting from ``_CALL_TUPLE_1``. Patch by Noam Cohen
+
+..
+
+.. date: 2025-12-11-13-01-49
+.. gh-issue: 142589
+.. nonce: nNAqgw
+.. section: C API
+
+Fix :c:func:`PyUnstable_Object_IsUniqueReferencedTemporary()` handling of
+tagged ints on the interpreter stack.
+
+..
+
+.. date: 2025-12-11-09-06-36
+.. gh-issue: 142571
+.. nonce: Csdxnn
+.. section: C API
+
+:c:func:`!PyUnstable_CopyPerfMapFile` now checks that opening the file
+succeeded before flushing.
+
+..
+
+.. date: 2025-12-03-16-35-24
+.. gh-issue: 142225
+.. nonce: vmCJoo
+.. section: C API
+
+Fixed the :c:macro:`PyABIInfo_VAR` macro.
+
+..
+
+.. date: 2025-12-03-14-41-07
+.. gh-issue: 141049
+.. nonce: VuAUe2
+.. section: C API
+
+:c:func:`!_PyObject_CallMethodId`, :c:func:`!_PyObject_GetAttrId` and
+:c:func:`!_PyUnicode_FromId` are deprecated since 3.15 and will be removed
+in 3.20. Instead, use :c:func:`PyUnicode_InternFromString()` and cache the
+result in the module state, then call :c:func:`PyObject_CallMethod` or
+:c:func:`PyObject_GetAttr`. Patch by Victor Stinner.
+
+..
+
+.. date: 2025-12-01-18-17-16
+.. gh-issue: 142163
+.. nonce: 2HiX5A
+.. section: C API
+
+Fix the ``HAVE_THREAD_LOCAL`` macro being defined without the
+``Py_BUILD_CORE`` macro set after including :file:`Python.h`.
+
+..
+
+.. date: 2025-11-21-10-34-00
+.. gh-issue: 137422
+.. nonce: tzZKLi
+.. section: C API
+
+Fix :term:`free threading` race condition in
+:c:func:`PyImport_AddModuleRef`. It was previously possible for two calls to
+the function return two different objects, only one of which was stored in
+:data:`sys.modules`.
+
+..
+
+.. date: 2025-11-18-18-36-15
+.. gh-issue: 141726
+.. nonce: ILrhyK
+.. section: C API
+
+Add :c:func:`PyDict_SetDefaultRef` to the Stable ABI.
+
+..
+
+.. date: 2025-11-18-04-16-09
+.. gh-issue: 140042
+.. nonce: S1C7id
+.. section: C API
+
+Removed the sqlite3_shutdown call that could cause closing connections for
+sqlite when used with multiple sub interpreters.
+
+..
+
+.. date: 2025-11-05-21-48-31
+.. gh-issue: 141070
+.. nonce: mkrhjQ
+.. section: C API
+
+Add :c:func:`PyUnstable_Object_Dump` to dump an object to ``stderr``. It
+should only be used for debugging. Patch by Victor Stinner.
+
+..
+
+.. date: 2025-09-22-16-32-00
+.. gh-issue: 139165
+.. nonce: 6Czn7S
+.. section: C API
+
+Expose the functions :c:func:`Py_SIZE`, :c:func:`Py_IS_TYPE` and
+:c:func:`Py_SET_SIZE` in the Stable ABI.
+
+..
+
+.. date: 2025-12-09-14-23-51
+.. gh-issue: 131372
+.. nonce: 2TAEyz
+.. section: Build
+
+Add ``LDVERSION`` and ``EXE`` to the ``base_interpreter`` value of
+``build-details.json``.
+
+..
+
+.. date: 2025-12-09-13-33-46
+.. gh-issue: 142454
+.. nonce: cqUxzQ
+.. section: Build
+
+When calculating the digest of the JIT stencils input, sort the hashed files
+by filenames before adding their content to the hasher. This ensures
+deterministic hash input and hence deterministic hash, independent on
+filesystem order.
+
+..
+
+.. date: 2025-12-04-20-57-15
+.. gh-issue: 131372
+.. nonce: o397g7
+.. section: Build
+
+``build-details.py`` will only be installed as part of the main install
+(``make install``). ``make altinstall`` will no longer include it.
+
+..
+
+.. date: 2025-12-03-10-44-42
+.. gh-issue: 142234
+.. nonce: i1kaFb
+.. section: Build
+
+Allow ``--enable-wasm-dynamic-linking`` for WASI. While CPython doesn't
+directly support it so external/downstream users do not have to patch in
+support for the flag.
+
+..
+
+.. date: 2025-11-28-21-43-07
+.. gh-issue: 142050
+.. nonce: PFi4tv
+.. section: Build
+
+Fixed a bug where JIT stencils produced on Windows contained debug data.
+Patch by Chris Eibl.
+
+..
+
+.. date: 2025-11-28-19-49-01
+.. gh-issue: 141808
+.. nonce: cV5K12
+.. section: Build
+
+Do not generate the jit stencils twice in case of PGO builds on Windows.
+
+..
+
+.. date: 2025-11-25-13-17-47
+.. gh-issue: 141926
+.. nonce: KmuM2h
+.. section: Build
+
+``RUNSHARED`` is no longer cleared when cross-compiling. Previously,
+``RUNSHARED`` was cleared when cross-compiling, which breaks PGO when using
+``--enabled-shared`` on systems where the cross-compiled CPython is
+otherwise executable (e.g., via transparent emulation).
+
+..
+
+.. date: 2025-11-20-23-15-39
+.. gh-issue: 141808
+.. nonce: NEewZC
+.. section: Build
+
+When running ``make clean-retain-profile``, keep the generated JIT stencils.
+That way, the stencils are not generated twice when Profile-guided
+optimization (PGO) is used. It also allows distributors to supply their own
+pre-built JIT stencils.
+
+..
+
+.. date: 2025-11-20-17-01-05
+.. gh-issue: 141784
+.. nonce: LkYI2n
+.. section: Build
+
+Fix ``_remote_debugging_module.c`` compilation on 32-bit Linux. Include
+Python.h before system headers to make sure that
+``_remote_debugging_module.c`` uses the same types (ABI) than Python. Patch
+by Victor Stinner.
+
+..
+
+.. date: 2025-11-19-09-21-17
+.. gh-issue: 141172
+.. nonce: cYWc4x
+.. section: Build
+
+Update to WASI SDK 29.
+
+..
+
+.. date: 2025-10-30-10-36-15
+.. gh-issue: 139707
+.. nonce: QJ1FfJ
+.. section: Build
+
+Add configure option :option:`--with-missing-stdlib-config=FILE` allows
+which distributors to pass a `JSON <https://www.json.org/json-en.html>`_
+configuration file containing custom error messages for missing
+:term:`standard library` modules.
+
+..
+
+.. date: 2025-04-29-18-25-34
+.. gh-issue: 108819
+.. nonce: qMUTRB
+.. section: Build
+
+Honor :option:`--with-platlibdir` in the pure-Python standard library
+installation path, if ``PLATLIBDIR`` doesn't match the value used in
+``LIBDIR``.
+++ /dev/null
-Honor :option:`--with-platlibdir` in the pure-Python standard library
-installation path, if ``PLATLIBDIR`` doesn't match the value used in
-``LIBDIR``.
+++ /dev/null
-Add configure option :option:`--with-missing-stdlib-config=FILE` allows
-which distributors to pass a `JSON <https://www.json.org/json-en.html>`_
-configuration file containing custom error messages for missing
-:term:`standard library` modules.
+++ /dev/null
-Update to WASI SDK 29.
+++ /dev/null
-Fix ``_remote_debugging_module.c`` compilation on 32-bit Linux. Include
-Python.h before system headers to make sure that
-``_remote_debugging_module.c`` uses the same types (ABI) than Python. Patch
-by Victor Stinner.
+++ /dev/null
-When running ``make clean-retain-profile``, keep the
-generated JIT stencils. That way, the stencils are not generated twice when
-Profile-guided optimization (PGO) is used. It also allows distributors to
-supply their own pre-built JIT stencils.
+++ /dev/null
-``RUNSHARED`` is no longer cleared when cross-compiling. Previously,
-``RUNSHARED`` was cleared when cross-compiling, which breaks PGO when using
-``--enabled-shared`` on systems where the cross-compiled CPython is otherwise
-executable (e.g., via transparent emulation).
+++ /dev/null
-Do not generate the jit stencils twice in case of PGO builds on Windows.
+++ /dev/null
-Fixed a bug where JIT stencils produced on Windows contained debug data. Patch by Chris Eibl.
+++ /dev/null
-Allow ``--enable-wasm-dynamic-linking`` for WASI. While CPython doesn't
-directly support it so external/downstream users do not have to patch in
-support for the flag.
+++ /dev/null
-``build-details.py`` will only be installed as part of the main install
-(``make install``). ``make altinstall`` will no longer include it.
+++ /dev/null
-When calculating the digest of the JIT stencils input, sort the hashed files
-by filenames before adding their content to the hasher. This ensures
-deterministic hash input and hence deterministic hash, independent on
-filesystem order.
+++ /dev/null
-Add ``LDVERSION`` and ``EXE`` to the ``base_interpreter`` value of
-``build-details.json``.
+++ /dev/null
-Expose the functions :c:func:`Py_SIZE`, :c:func:`Py_IS_TYPE` and
-:c:func:`Py_SET_SIZE` in the Stable ABI.
+++ /dev/null
-Add :c:func:`PyUnstable_Object_Dump` to dump an object to ``stderr``. It should
-only be used for debugging. Patch by Victor Stinner.
+++ /dev/null
-Removed the sqlite3_shutdown call that could cause closing connections for sqlite when used with multiple sub interpreters.
+++ /dev/null
-Add :c:func:`PyDict_SetDefaultRef` to the Stable ABI.
+++ /dev/null
-Fix :term:`free threading` race condition in
-:c:func:`PyImport_AddModuleRef`. It was previously possible for two calls to
-the function return two different objects, only one of which was stored in
-:data:`sys.modules`.
+++ /dev/null
-Fix the ``HAVE_THREAD_LOCAL`` macro being defined without the
-``Py_BUILD_CORE`` macro set after including :file:`Python.h`.
+++ /dev/null
-:c:func:`!_PyObject_CallMethodId`, :c:func:`!_PyObject_GetAttrId` and
-:c:func:`!_PyUnicode_FromId` are deprecated since 3.15 and will be removed in
-3.20. Instead, use :c:func:`PyUnicode_InternFromString()` and cache the result in
-the module state, then call :c:func:`PyObject_CallMethod` or
-:c:func:`PyObject_GetAttr`. Patch by Victor Stinner.
+++ /dev/null
-Fixed the :c:macro:`PyABIInfo_VAR` macro.
+++ /dev/null
-:c:func:`!PyUnstable_CopyPerfMapFile` now checks that opening the file succeeded before flushing.
+++ /dev/null
-Fix :c:func:`PyUnstable_Object_IsUniqueReferencedTemporary()` handling of
-tagged ints on the interpreter stack.
+++ /dev/null
-Eliminate redundant refcounting from ``_CALL_TUPLE_1``. Patch by Noam Cohen
+++ /dev/null
-Eliminate redundant refcounting from ``_CALL_BUILTIN_O``.
+++ /dev/null
-Eliminate redundant refcounting from ``_CALL_STR_1``.
+++ /dev/null
-For the free-threaded build, avoid locking the :class:`set` object for the
-``__contains__`` method.
+++ /dev/null
-Fix a bug during JIT compilation failure which caused garbage collection debug assertions to fail.
+++ /dev/null
-Change ``backoff counter`` to use prime numbers instead of powers of 2.
-Use only 3 bits for ``counter`` and 13 bits for ``value``.
-This allows to support values up to 8191. Patch by Mikhail Efimov.
+++ /dev/null
-Improve multithreaded scaling of dataclasses on the free-threaded build.
+++ /dev/null
-Allowed defining the *__dict__* and *__weakref__* :ref:`__slots__ <slots>`
-for any class.
+++ /dev/null
-Only raise a ``RecursionError`` or trigger a fatal error if the stack
-pointer is both below the limit pointer *and* above the stack base. If
-outside of these bounds assume that it is OK. This prevents false positives
-when user-space threads swap stacks.
+++ /dev/null
-Expose a ``"duration"`` stat in :func:`gc.get_stats` and
-:data:`gc.callbacks`.
+++ /dev/null
-Ensure the :meth:`~object.__repr__` for :exc:`ExceptionGroup` and :exc:`BaseExceptionGroup` does
-not change when the exception sequence that was original passed in to its constructor is subsequently mutated.
+++ /dev/null
-Fix :c:macro:`Py_mod_gil` with API added in :pep:`793`:
-:c:func:`!PyModule_FromSlotsAndSpec` and ``PyModExport`` hooks
+++ /dev/null
-Expose a ``"candidates"`` stat in :func:`gc.get_stats` and
-:data:`gc.callbacks`.
+++ /dev/null
-Fix inconsistent state when enabling or disabling monitoring events too many
-times.
+++ /dev/null
-Add incomplete sample detection to prevent corrupted profiling data. Each
-thread state now contains an embedded base frame (sentinel at the bottom of
-the frame stack) with owner type ``FRAME_OWNED_BY_INTERPRETER``. The profiler
-validates that stack unwinding terminates at this sentinel frame. Samples that
-fail to reach the base frame (due to race conditions, memory corruption, or
-other errors) are now rejected rather than being included as spurious data.
+++ /dev/null
-When importing a module, use Python's regular file object to ensure that
-writes to ``.pyc`` files are complete or an appropriate error is raised.
+++ /dev/null
-Fix invalid memory read in the ``ENTER_EXECUTOR`` instruction.
+++ /dev/null
-Protect against specialization failures in the tracing JIT compiler for performance reasons.
+++ /dev/null
-Raise :exc:`ValueError` instead of crashing when empty string is used as a name
-in ``_imp.create_builtin()``.
+++ /dev/null
-Raise :exc:`ModuleNotFoundError` instead of crashing when a nonexistent module
-is used as a name in ``_imp.create_builtin()``.
+++ /dev/null
-Annotate anonymous mmap usage only when supported by the
-Linux kernel and if ``-X dev`` is used or Python is built in debug mode. Patch by Donghee Na.
+++ /dev/null
-Stop setting ``__cached__`` on modules.
+++ /dev/null
-Fix quadratically increasing garbage collection delays in free-threaded
-build.
+++ /dev/null
-Remove all ``*.load_module()`` usage and definitions from the import system
-and importlib. The method has been deprecated in favor of
-``importlib.abc.Loader.exec_module()`` since Python 3.4.
+++ /dev/null
-Check against abstract stack overflow in the JIT optimizer.
+++ /dev/null
-Fix crash when inserting into a split table dictionary with a non
-:class:`str` key that matches an existing key.
+++ /dev/null
-Fix missing type watcher when promoting attribute loads to constants in the JIT. Patch by Ken Jin. Reproducer by Yuancheng Jiang.
+++ /dev/null
-Implement a limited form of register allocation known as "top of stack
-caching" in the JIT. It works by keeping 0-3 of the top items in the stack
-in registers. The code generator generates multiple versions of those uops
-that do not escape and are relatively small. During JIT compilation, the
-copy that produces the least memory traffic is selected, spilling or
-reloading values when needed.
+++ /dev/null
-Decrease the size of the generated stencils and the runtime JIT code. Patch by Diego Russo.
+++ /dev/null
-Fix incorrect keyword suggestions for syntax errors in :mod:`traceback`. The
-keyword typo suggestion mechanism would incorrectly suggest replacements when
-the extracted source code was incomplete rather than containing an actual typo.
-Patch by Pablo Galindo.
+++ /dev/null
-Improve the "Perhaps you forgot a comma?" syntax error for multi-line string
-concatenations to point to the last string instead of the first, making it
-easier to locate where the comma is missing. Patch by Pablo Galindo.
+++ /dev/null
-Fix SIGILL crash on m68k due to incorrect assembly constraint.
+++ /dev/null
-Make the attributes in :mod:`zlib` thread-safe on the :term:`free threaded
-<free threading>` build.
+++ /dev/null
-Fix reference counting when adjacent literal parts are merged while constructing
-:class:`string.templatelib.Template`, preventing the displaced string object
-from leaking.
+++ /dev/null
-Fix a free-threaded GC performance regression. If there are many untracked
-tuples, the GC will run too often, resulting in poor performance. The fix
-is to include untracked tuples in the "long lived" object count. The number
-of frozen objects is also now included since the free-threaded GC must
-scan those too.
+++ /dev/null
-Fix a crash in :func:`divmod` when :func:`!_pylong.int_divmod` does not
-return a tuple of length two exactly. Patch by Bénédikt Tran.
+++ /dev/null
-Eliminate redundant refcounting from ``_CALL_LIST_APPEND``.
+++ /dev/null
-Make the attributes in :mod:`bz2` thread-safe on the :term:`free threaded
-<free threading>` build.
+++ /dev/null
-Tracebacks will be displayed in fallback mode even if :func:`io.open` is lost.
-Previously, this would crash the interpreter.
-Patch by Bartosz Sławecki.
+++ /dev/null
-JIT: Fix segfault caused by not flushing the stack to memory at side exits.
+++ /dev/null
-Eliminate redundant refcounting from ``_STORE_ATTR_INSTANCE_VALUE``.
+++ /dev/null
-:mod:`xml.sax.handler`: Make Documentation of
-:data:`xml.sax.handler.feature_external_ges` warn of opening up to `external
-entity attacks <https://en.wikipedia.org/wiki/XML_external_entity_attack>`_.
-Patch by Sebastian Pipping.
+++ /dev/null
-Fix support for namespace packages in :mod:`modulefinder`.
+++ /dev/null
-Fix a potential memory denial of service in the :mod:`pickle` module.
-When reading a pickled data received from untrusted source, it could cause
-an arbitrary amount of memory to be allocated, even if the code that is
-allowed to execute is restricted by overriding the
-:meth:`~pickle.Unpickler.find_class` method.
-This could have led to symptoms including a :exc:`MemoryError`, swapping, out
-of memory (OOM) killed processes or containers, or even system crashes.
+++ /dev/null
-Add ``__all__`` to :mod:`tkinter.simpledialog`.
+++ /dev/null
-Fixed :func:`subprocess.Popen.communicate` ``input=`` handling of :class:`memoryview`
-instances that were non-byte shaped on POSIX platforms. Those are now properly
-cast to a byte shaped view instead of truncating the input. Windows platforms
-did not have this bug.
+++ /dev/null
-Flag: a ``dir()`` on a ``Flag`` enumeration now shows non-canonical members.
-(i.e. aliases).
+++ /dev/null
-Add parsing for ``References`` and ``In-Reply-To`` headers to the :mod:`email`
-library that parses the header content as lists of message id tokens. This
-prevents them from being folded incorrectly.
+++ /dev/null
-Add support for single-dash long options and alternate prefix characters in
-:class:`argparse.BooleanOptionalAction`.
+++ /dev/null
-Fix inferring *dest* from a single-dash long option in :mod:`argparse`. If a
-short option and a single-dash long option are passed to
-:meth:`!add_argument`, *dest* is now inferred from the single-dash long
-option.
+++ /dev/null
-Make importlib.reload no-op for lazy modules.
+++ /dev/null
-:mod:`pydoc`: Fix :exc:`DeprecationWarning` being raised when generating doc for
-:term:`stdlib` modules.
+++ /dev/null
-Distinguish stdout and stderr when colorizing output in argparse module.
+++ /dev/null
-Add heatmap visualization mode to the Tachyon sampling profiler. The new
-``--heatmap`` output format provides a line-by-line view showing execution
-intensity with color-coded samples, inline statistics, and interactive call
-graph navigation between callers and callees.
+++ /dev/null
-Fix handling of unclosed character references (named and numerical)
-followed by the end of file in :class:`html.parser.HTMLParser` with
-``convert_charrefs=False``.
+++ /dev/null
-:mod:`collections`: Ensure that the methods ``UserString.rindex()`` and
-``UserString.index()`` accept :class:`collections.UserString` instances as the
-sub argument.
+++ /dev/null
-Make csv module thread-safe on the :term:`free threaded <free threading>`
-build.
+++ /dev/null
-Remove a copy from :meth:`io.RawIOBase.read`. If the underlying I/O class
-keeps a reference to the mutable memory, raise a :exc:`BufferError`.
+++ /dev/null
-Add async-aware profiling to the Tachyon sampling profiler. The profiler now reconstructs and displays async task hierarchies in flamegraphs, making the output more actionable for users. Patch by Savannah Ostrowski and Pablo Galindo Salgado.
+++ /dev/null
-Add :func:`readline.get_pre_input_hook` function to retrieve the current
-pre-input hook. This allows applications to save and restore the hook
-without overwriting user settings. Patch by Sanyam Khurana.
+++ /dev/null
-Fix musl version detection on Void Linux.
+++ /dev/null
-Fix :mod:`doctest` to correctly report line numbers for doctests in ``__test__`` dictionary when formatted as triple-quoted strings by finding unique lines in the string and matching them in the source file.
+++ /dev/null
-Check ``stdin`` instead of ``stdout`` for ``use_rawinput`` in :mod:`pdb`.
+++ /dev/null
-Add a new ``--live`` mode to the tachyon profiler in
-:mod:`!profiling.sampling` module. This mode consist of a live TUI that
-displays real-time profiling statistics as the target application runs,
-similar to ``top``. Patch by Pablo Galindo
+++ /dev/null
-Fix bad file descriptor errors from ``_posixsubprocess`` on AIX.
+++ /dev/null
-Break reference cycles created by each call to :func:`json.dump` or
-:meth:`json.JSONEncoder.iterencode`.
+++ /dev/null
-Add colour to defaults in :mod:`argparse` help. Patch by Hugo van Kemenade.
+++ /dev/null
-Support :term:`file-like object` raising :exc:`OSError` from :meth:`~io.IOBase.fileno` in color
-detection (``_colorize.can_colorize()``). This can occur when ``sys.stdout`` is redirected.
+++ /dev/null
-Fix :meth:`asyncio.run_coroutine_threadsafe` leaving underlying cancelled
-asyncio task running.
+++ /dev/null
-Add :data:`!socket.IPV6_HDRINCL` constant.
+++ /dev/null
-Update :ref:`asyncio-streams` to use :meth:`bytearray.take_bytes` for a over
-10% performance improvement on pyperformance asyncio_tcp benchmark.
+++ /dev/null
-Fixed an issue where pdb.line_prefix assignment was ignored if assigned after the module was imported.
+++ /dev/null
-The ``profiling.sampling`` flamegraph profiler now displays thread status
-statistics showing the percentage of time threads spend holding the GIL,
-running without the GIL, waiting for the GIL, and performing garbage
-collection. These statistics help identify GIL contention and thread behavior
-patterns. When filtering by thread, the display shows per-thread metrics.
+++ /dev/null
-Fix thread safety issue with :mod:`re` scanner objects in free-threaded
-builds.
+++ /dev/null
-Fix :mod:`pdb` breakpoint resolution for class methods when the module defining the class is not imported.\r
+++ /dev/null
-Remove a data copy from :func:`base64.b32decode` and
-:func:`base64.b32encode` by using :meth:`bytearray.take_bytes`.
+++ /dev/null
-Remove data copy from :func:`wave.Wave_read.readframes` and
-:func:`wave.Wave_write.writeframes` by using :meth:`bytearray.take_bytes`.
+++ /dev/null
-Remove data copy from :mod:`codecs` ``punycode`` encoding by using
-:meth:`bytearray.take_bytes`.
+++ /dev/null
-Remove data copy from :mod:`encodings.idna` :meth:`~codecs.Codec.encode` and
-:meth:`~codecs.IncrementalEncoder.encode` by using :meth:`bytearray.take_bytes`.
+++ /dev/null
-Remove data copy from :mod:`re` compilation of regexes with large charsets
-by using :meth:`bytearray.take_bytes`.
+++ /dev/null
-Fix a bug in the :mod:`email.policy.default` folding algorithm which incorrectly resulted in a doubled newline when a line ending at exactly max_line_length was followed by an unfoldable token.
+++ /dev/null
-Correctly allow :exc:`KeyboardInterrupt` to stop the process when using
-:mod:`!profiling.sampling`.
+++ /dev/null
-When :meth:`subprocess.Popen.communicate` was called with *input* and a
-*timeout* and is called for a second time after a
-:exc:`~subprocess.TimeoutExpired` exception before the process has died, it
-should no longer hang.
+++ /dev/null
-Add color to all interpolated values in :mod:`argparse` help, like ``%(default)s`` or ``%(choices)s``. Patch by Alex Prengère.
+++ /dev/null
-Fix :func:`subprocess.Popen.communicate` timeout handling on Windows
-when writing large input. Previously, the timeout was ignored during
-stdin writing, causing the method to block indefinitely if the child
-process did not consume input quickly. The stdin write is now performed
-in a background thread, allowing the timeout to be properly enforced.
+++ /dev/null
-When the stdin being used by a :class:`subprocess.Popen` instance is closed,
-this is now ignored in :meth:`subprocess.Popen.communicate` instead of
-leaving the class in an inconsistent state.
+++ /dev/null
-Allow :mod:`pdb` to set breakpoints on async functions with function names.
+++ /dev/null
-Fix :mod:`cmath` data race when initializing trigonometric tables with
-subinterpreters.
+++ /dev/null
-The ``_remote_debugging`` module now implements frame caching in the
-``RemoteUnwinder`` class to reduce memory reads when profiling remote
-processes. When ``cache_frames=True``, unchanged portions of the call stack
-are reused from previous samples, significantly improving profiling
-performance for deep call stacks.
+++ /dev/null
-Remove the *debug_override* parameter from
-:func:`importlib.util.cache_from_source` which has been deprecated since
-Python 3.5.
+++ /dev/null
-Fix two regressions in :mod:`dataclasses` in Python 3.14.1 related to
-annotations.
-
-* An exception is no longer raised if ``slots=True`` is used and the
- ``__init__`` method does not have an ``__annotate__`` attribute
- (likely because ``init=False`` was used).
-
-* An exception is no longer raised if annotations are requested on the
- ``__init__`` method and one of the fields is not present in the class
- annotations. This can occur in certain dynamic scenarios.
-
-Patch by Jelle Zijlstra.
+++ /dev/null
-The resource tracker in the :mod:`multiprocessing` module can now understand
-messages from older versions of itself. This avoids issues with upgrading
-Python while it is running. (Note that such 'in-place' upgrades are not
-tested.)
+++ /dev/null
-``MisplacedEnvelopeHeaderDefect`` and ``Missing header name`` defects are now correctly passed to the ``handle_defect`` method of ``policy`` in :class:`~email.parser.FeedParser`.
+++ /dev/null
-Remove ``color`` parameter from :class:`!argparse.HelpFormatter` constructor. Color is controlled by :class:`~argparse.ArgumentParser`.
+++ /dev/null
-Improve :mod:`argparse` performance by caching the formatter used for argument validation.
+++ /dev/null
-Fix :mod:`argparse` to preserve ``|`` separators in mutually exclusive groups when the usage line wraps due to length.
+++ /dev/null
-Fix typing ``'q'`` at the help of the interactive tachyon profiler exiting
-the profiler.
+++ /dev/null
-Fix :func:`winreg.QueryValueEx` to not accidentally read garbage buffer under race condition.
+++ /dev/null
-Fix usage formatting for positional arguments in mutually exclusive groups in :mod:`argparse`.
-in :mod:`argparse`.
+++ /dev/null
-Fix: profiling.sampling may cause assertion ``!(has_gil &&
-gil_requested)``
+++ /dev/null
-Subparser help now includes required optional arguments from the parent parser in the usage, making it clearer what arguments are needed to run a subcommand. Patch by Savannah Ostrowski.
+++ /dev/null
-Pdb can now run scripts from anonymous pipes used in process substitution.
-Patch by Bartosz Sławecki.
+++ /dev/null
-Fix cumulative percentage calculation for recursive functions in the new
-sampling profiler. When profiling recursive functions, cumulative statistics
-(cumul%, cumtime) could exceed 100% because each recursive frame in a stack
-was counted separately. For example, a function recursing 500 times in every
-sample would show 50000% cumulative presence. The fix deduplicates locations
-within each sample so cumulative stats correctly represent "percentage of
-samples where this function was on the stack". Patch by Pablo Galindo.
+++ /dev/null
-Fix usage formatting for mutually exclusive groups in :mod:`argparse`
-when they are preceded by positional arguments or followed or intermixed
-with other optional arguments.
+++ /dev/null
-Add backtick markup support in :mod:`argparse` description and epilog text to highlight inline code when color output is enabled.
+++ /dev/null
-Add bytecode-level instruction profiling to the sampling profiler via the
-new ``--opcodes`` flag. When enabled, the profiler captures which bytecode
-opcode is executing at each sample, including Python 3.11+ adaptive
-specializations, and visualizes this data in the heatmap, flamegraph, gecko,
-and live output formats. Patch by Pablo Galindo
+++ /dev/null
-Fixed a possible leaked GIL in _PySSL_keylog_callback.
+++ /dev/null
-The help text for required options in :mod:`argparse` no
-longer extended with " (default: None)".
+++ /dev/null
-The ``profiling.sampling`` flamegraph profiler now supports inverted\r
-flamegraph view that aggregates all leaf nodes. In a standard flamegraph, if\r
-a hot function is called from multiple locations, it appears multiple times\r
-as separate leaf nodes. In the inverted flamegraph, all occurrences of the\r
-same leaf function are merged into a single aggregated node at the root,\r
-showing the total hotness of that function in one place. The children of each\r
-aggregated node represent its callers, making it easier to identify which\r
-functions consume the most CPU time and where they are called from.
+++ /dev/null
-:mod:`hmac`: correctly copy :class:`~hmac.HMAC` attributes for objects
-copied through :meth:`HMAC.copy() <hmac.HMAC.copy>`. Patch by Bénédikt Tran.
+++ /dev/null
-Avoid reference count operations in garbage collection of :mod:`ctypes`
-objects.
+++ /dev/null
-:mod:`traceback`: Fix location of carets in :exc:`SyntaxError`\s when the
-source contains wide characters.
+++ /dev/null
-Add ``--mode=exception`` to the sampling profiler to capture samples only from
-threads with an active exception, useful for analyzing exception handling
-overhead. Patch by Pablo Galindo.
+++ /dev/null
-Fix crash when a task gets re-registered during finalization in :mod:`asyncio`. Patch by Kumar Aditya.
+++ /dev/null
-Added type check during initialization of the :mod:`decimal` module to
-prevent a crash in case of broken stdlib. Patch by Sergey B Kirpichev.
+++ /dev/null
-Add ``--subprocesses`` flag to :mod:`profiling.sampling` CLI to automatically
-profile subprocesses spawned by the target. When enabled, the profiler
-monitors for new Python subprocesses and profiles each one separately,
-writing results to individual output files. This is useful for profiling
-applications that use :mod:`multiprocessing`, :class:`~concurrent.futures.ProcessPoolExecutor`,
-or other subprocess-based parallelism. Patch by Pablo Galindo.
+++ /dev/null
-Deprecate ``__version__`` from :mod:`http.server`. Patch by Hugo van
-Kemenade.
+++ /dev/null
-:mod:`unittest.mock`: fix a thread safety issue where :attr:`Mock.call_count
-<unittest.mock.Mock.call_count>` may return inaccurate values when the mock
-is called concurrently from multiple threads.
+++ /dev/null
-Deprecate ``__version__`` from :mod:`wsgiref.simple_server`. Patch by Hugo
-van Kemenade.
+++ /dev/null
-Deprecate ``__version__`` from :mod:`ctypes`. Patch by Hugo van Kemenade.
+++ /dev/null
-Fix crash in ``TextIOWrapper.close()`` when the underlying buffer's
-``closed`` property calls :meth:`~io.TextIOBase.detach`.
+++ /dev/null
-Add the *ownerDocument* attribute to :mod:`xml.dom.minidom` elements and attributes
-created by directly instantiating the ``Element`` or ``Attr`` class. Note that
-this way of creating nodes is not supported; creator functions like
-:py:meth:`xml.dom.Document.documentElement` should be used instead.
+++ /dev/null
-Fix a potential memory denial of service in the :mod:`plistlib` module.
-When reading a Plist file received from untrusted source, it could cause
-an arbitrary amount of memory to be allocated.
-This could have led to symptoms including a :exc:`MemoryError`, swapping, out
-of memory (OOM) killed processes or containers, or even system crashes.
+++ /dev/null
-Fix a potential memory denial of service in the :mod:`http.client` module.
-When connecting to a malicious server, it could cause
-an arbitrary amount of memory to be allocated.
-This could have led to symptoms including a :exc:`MemoryError`, swapping, out
-of memory (OOM) killed processes or containers, or even system crashes.
+++ /dev/null
-Fix buffer overflow in ``_Py_wrealpath()`` for paths exceeding ``MAXPATHLEN`` bytes
-by using dynamic memory allocation instead of fixed-size buffer.
-Patch by Shamil Abdulaev.
+++ /dev/null
-Remove quadratic behavior in ``xml.minidom`` node ID cache clearing.
+++ /dev/null
-Make ``test_sysconfig.test_parse_makefile_renamed_vars`` less fragile by
-clearing the environment variables before parsing the Makefile.
+++ /dev/null
-Fix flaky test_profiling tests on i686 and s390x architectures by increasing slow_fibonacci call frequency from every 5th iteration to every 2nd iteration.
+++ /dev/null
-Each slice of an iOS XCframework now contains a ``lib`` folder that contains
-a symlink to the libpython dylib. This allows binary modules to be compiled
-for iOS using dynamic libreary linking, rather than Framework linking.
-This is Python version 3.15.0 alpha 2
+This is Python version 3.15.0 alpha 3
=====================================
.. image:: https://github.com/python/cpython/actions/workflows/build.yml/badge.svg?branch=main&event=push