-# Autogenerated by Sphinx on Tue Feb 3 17:32:13 2026
+# Autogenerated by Sphinx on Tue Apr 7 16:13:12 2026
# as part of the release process.
topics = {
| "[" [target_list] "]"
| attributeref
| subscription
- | slicing
| "*" target
-(See section Primaries for the syntax definitions for *attributeref*,
-*subscription*, and *slicing*.)
+(See section Primaries for the syntax definitions for *attributeref*
+and *subscription*.)
An assignment statement evaluates the expression list (remember that
this can be a single expression or a comma-separated list, the latter
Assignment is defined recursively depending on the form of the target
(list). When a target is part of a mutable object (an attribute
-reference, subscription or slicing), the mutable object must
-ultimately perform the assignment and decide about its validity, and
-may raise an exception if the assignment is unacceptable. The rules
-observed by various types and the exceptions raised are given with the
-definition of the object types (see section The standard type
-hierarchy).
+reference or subscription), the mutable object must ultimately perform
+the assignment and decide about its validity, and may raise an
+exception if the assignment is unacceptable. The rules observed by
+various types and the exceptions raised are given with the definition
+of the object types (see section The standard type hierarchy).
Assignment of an object to a target list, optionally enclosed in
parentheses or square brackets, is recursively defined as follows.
attributes, such as properties created with "property()".
* If the target is a subscription: The primary expression in the
- reference is evaluated. It should yield either a mutable sequence
- object (such as a list) or a mapping object (such as a dictionary).
- Next, the subscript expression is evaluated.
+ reference is evaluated. Next, the subscript expression is evaluated.
+ Then, the primary’s "__setitem__()" method is called with two
+ arguments: the subscript and the assigned object.
+
+ Typically, "__setitem__()" is defined on mutable sequence objects
+ (such as lists) and mapping objects (such as dictionaries), and
+ behaves as follows.
If the primary is a mutable sequence object (such as a list), the
subscript must yield an integer. If it is negative, the sequence’s
existing key/value pair with the same key value, or insert a new
key/value pair (if no key with the same value existed).
- For user-defined objects, the "__setitem__()" method is called with
- appropriate arguments.
-
-* If the target is a slicing: The primary expression in the reference
- is evaluated. It should yield a mutable sequence object (such as a
- list). The assigned object should be a sequence object of the same
- type. Next, the lower and upper bound expressions are evaluated,
- insofar they are present; defaults are zero and the sequence’s
- length. The bounds should evaluate to integers. If either bound is
- negative, the sequence’s length is added to it. The resulting
- bounds are clipped to lie between zero and the sequence’s length,
- inclusive. Finally, the sequence object is asked to replace the
- slice with the items of the assigned sequence. The length of the
- slice may be different from the length of the assigned sequence,
- thus changing the length of the target sequence, if the target
- sequence allows it.
-
-**CPython implementation detail:** In the current implementation, the
-syntax for targets is taken to be the same as for expressions, and
-invalid syntax is rejected during the code generation phase, causing
-less detailed error messages.
+ If the target is a slicing: The primary expression should evaluate
+ to a mutable sequence object (such as a list). The assigned object
+ should be *iterable*. The slicing’s lower and upper bounds should be
+ integers; if they are "None" (or not present), the defaults are zero
+ and the sequence’s length. If either bound is negative, the
+ sequence’s length is added to it. The resulting bounds are clipped
+ to lie between zero and the sequence’s length, inclusive. Finally,
+ the sequence object is asked to replace the slice with the items of
+ the assigned sequence. The length of the slice may be different
+ from the length of the assigned sequence, thus changing the length
+ of the target sequence, if the target sequence allows it.
Although the definition of assignment implies that overlaps between
the left-hand side and the right-hand side are ‘simultaneous’ (for
binary operation and an assignment statement:
augmented_assignment_stmt: augtarget augop (expression_list | yield_expression)
- augtarget: identifier | attributeref | subscription | slicing
+ augtarget: identifier | attributeref | subscription
augop: "+=" | "-=" | "*=" | "@=" | "/=" | "//=" | "%=" | "**="
| ">>=" | "<<=" | "&=" | "^=" | "|="
Is semantically equivalent to:
- iter = (ITER)
- iter = type(iter).__aiter__(iter)
+ iter = (ITER).__aiter__()
running = True
while running:
try:
- TARGET = await type(iter).__anext__(iter)
+ TARGET = await iter.__anext__()
except StopAsyncIteration:
running = False
else:
else:
SUITE2
-See also "__aiter__()" and "__anext__()" for details.
+except that implicit special method lookup is used for "__aiter__()"
+and "__anext__()".
It is a "SyntaxError" to use an "async for" statement outside the body
of a coroutine function.
is semantically equivalent to:
manager = (EXPRESSION)
- aenter = type(manager).__aenter__
- aexit = type(manager).__aexit__
- value = await aenter(manager)
+ aenter = manager.__aenter__
+ aexit = manager.__aexit__
+ value = await aenter()
hit_except = False
try:
SUITE
except:
hit_except = True
- if not await aexit(manager, *sys.exc_info()):
+ if not await aexit(*sys.exc_info()):
raise
finally:
if not hit_except:
- await aexit(manager, None, None, None)
+ await aexit(None, None, None)
-See also "__aenter__()" and "__aexit__()" for details.
+except that implicit special method lookup is used for "__aenter__()"
+and "__aexit__()".
It is a "SyntaxError" to use an "async with" statement outside the
body of a coroutine function.
'atom-literals': r'''Literals
********
-Python supports string and bytes literals and various numeric
-literals:
+A *literal* is a textual representation of a value. Python supports
+numeric, string and bytes literals. Format strings and template
+strings are treated as string literals.
+
+Numeric literals consist of a single "NUMBER" token, which names an
+integer, floating-point number, or an imaginary number. See the
+Numeric literals section in Lexical analysis documentation for
+details.
+
+String and bytes literals may consist of several tokens. See section
+String literal concatenation for details.
+
+Note that negative and complex numbers, like "-3" or "3+4.2j", are
+syntactically not literals, but unary or binary arithmetic operations
+involving the "-" or "+" operator.
+
+Evaluation of a literal yields an object of the given type ("int",
+"float", "complex", "str", "bytes", or "Template") with the given
+value. The value may be approximated in the case of floating-point and
+imaginary literals.
+
+The formal grammar for literals is:
literal: strings | NUMBER
-Evaluation of a literal yields an object of the given type (string,
-bytes, integer, floating-point number, complex number) with the given
-value. The value may be approximated in the case of floating-point
-and imaginary (complex) literals. See section Literals for details.
-See section String literal concatenation for details on "strings".
+
+Literals and object identity
+============================
All literals correspond to immutable data types, and hence the
object’s identity is less important than its value. Multiple
occurrence in the program text or a different occurrence) may obtain
the same object or a different object with the same value.
+CPython implementation detail: For example, in CPython, *small*
+integers with the same value evaluate to the same object:
+
+ >>> x = 7
+ >>> y = 7
+ >>> x is y
+ True
+
+However, large integers evaluate to different objects:
+
+ >>> x = 123456789
+ >>> y = 123456789
+ >>> x is y
+ False
+
+This behavior may change in future versions of CPython. In particular,
+the boundary between “small” and “large” integers has already changed
+in the past.CPython will emit a "SyntaxWarning" when you compare
+literals using "is":
+
+ >>> x = 7
+ >>> x is 7
+ <input>:1: SyntaxWarning: "is" with 'int' literal. Did you mean "=="?
+ True
+
+See When can I rely on identity tests with the is operator? for more
+information.
+
+Template strings are immutable but may reference mutable objects as
+"Interpolation" values. For the purposes of this section, two
+t-strings have the “same value” if both their structure and the
+*identity* of the values match.
+
+**CPython implementation detail:** Currently, each evaluation of a
+template string results in a different object.
+
String literal concatenation
============================
-Multiple adjacent string or bytes literals (delimited by whitespace),
-possibly using different quoting conventions, are allowed, and their
-meaning is the same as their concatenation:
+Multiple adjacent string or bytes literals, possibly using different
+quoting conventions, are allowed, and their meaning is the same as
+their concatenation:
>>> "hello" 'world'
"helloworld"
-Formally:
-
- strings: ( STRING | fstring)+ | tstring+
-
This feature is defined at the syntactical level, so it only works
with literals. To concatenate string expressions at run time, the ‘+’
operator may be used:
>>> t"Hello" t"{name}!"
Template(strings=('Hello', '!'), interpolations=(...))
+
+Formally:
+
+ strings: (STRING | fstring)+ | tstring+
''',
'attribute-access': r'''Customizing attribute access
****************************
binary operation and an assignment statement:
augmented_assignment_stmt: augtarget augop (expression_list | yield_expression)
- augtarget: identifier | attributeref | subscription | slicing
+ augtarget: identifier | attributeref | subscription
augop: "+=" | "-=" | "*=" | "@=" | "/=" | "//=" | "%=" | "**="
| ">>=" | "<<=" | "&=" | "^=" | "|="
The "%" (modulo) operator yields the remainder from the division of
the first argument by the second. The numeric arguments are first
-converted to a common type. A zero right argument raises the
+converted to a common type. A zero right argument raises the
"ZeroDivisionError" exception. The arguments may be floating-point
numbers, e.g., "3.14%0.7" equals "0.34" (since "3.14" equals "4*0.7 +
0.34".) The modulo operator always yields a result with the same sign
is semantically equivalent to:
manager = (EXPRESSION)
- enter = type(manager).__enter__
- exit = type(manager).__exit__
- value = enter(manager)
+ enter = manager.__enter__
+ exit = manager.__exit__
+ value = enter()
hit_except = False
try:
SUITE
except:
hit_except = True
- if not exit(manager, *sys.exc_info()):
+ if not exit(*sys.exc_info()):
raise
finally:
if not hit_except:
- exit(manager, None, None, None)
+ exit(None, None, None)
+
+except that implicit special method lookup is used for "__enter__()"
+and "__exit__()".
With more than one item, the context managers are processed as if
multiple "with" statements were nested:
Is semantically equivalent to:
- iter = (ITER)
- iter = type(iter).__aiter__(iter)
+ iter = (ITER).__aiter__()
running = True
while running:
try:
- TARGET = await type(iter).__anext__(iter)
+ TARGET = await iter.__anext__()
except StopAsyncIteration:
running = False
else:
else:
SUITE2
-See also "__aiter__()" and "__anext__()" for details.
+except that implicit special method lookup is used for "__aiter__()"
+and "__anext__()".
It is a "SyntaxError" to use an "async for" statement outside the body
of a coroutine function.
is semantically equivalent to:
manager = (EXPRESSION)
- aenter = type(manager).__aenter__
- aexit = type(manager).__aexit__
- value = await aenter(manager)
+ aenter = manager.__aenter__
+ aexit = manager.__aexit__
+ value = await aenter()
hit_except = False
try:
SUITE
except:
hit_except = True
- if not await aexit(manager, *sys.exc_info()):
+ if not await aexit(*sys.exc_info()):
raise
finally:
if not hit_except:
- await aexit(manager, None, None, None)
+ await aexit(None, None, None)
-See also "__aenter__()" and "__aexit__()" for details.
+except that implicit special method lookup is used for "__aenter__()"
+and "__aexit__()".
It is a "SyntaxError" to use an "async with" statement outside the
body of a coroutine function.
When a description of an arithmetic operator below uses the phrase
“the numeric arguments are converted to a common real type”, this
-means that the operator implementation for built-in types works as
-follows:
-
-* If both arguments are complex numbers, no conversion is performed;
-
-* if either argument is a complex or a floating-point number, the
- other is converted to a floating-point number;
+means that the operator implementation for built-in numeric types
+works as described in the Numeric Types section of the standard
+library documentation.
-* otherwise, both must be integers and no conversion is necessary.
-
-Some additional rules apply for certain operators (e.g., a string as a
-left argument to the ‘%’ operator). Extensions must define their own
-conversion behavior.
+Some additional rules apply for certain operators and non-numeric
+operands (for example, a string as a left argument to the "%"
+operator). Extensions must define their own conversion behavior.
''',
'customization': r'''Basic customization
*******************
formatting to one of the built-in types, or use a similar
formatting option syntax.
- See Format Specification Mini-Language for a description of the
+ See Format specification mini-language for a description of the
standard formatting syntax.
The return value must be a string object.
intended to provide protection against a denial-of-service caused
by carefully chosen inputs that exploit the worst case
performance of a dict insertion, *O*(*n*^2) complexity. See
- http://ocert.org/advisories/ocert-2011-003.html for
+ https://ocert.org/advisories/ocert-2011-003.html for
details.Changing hash values affects the iteration order of sets.
Python has never made guarantees about this ordering (and it
typically varies between 32-bit and 64-bit builds).See also
statement in the same code block. Trying to delete an unbound name
raises a "NameError" exception.
-Deletion of attribute references, subscriptions and slicings is passed
-to the primary object involved; deletion of a slicing is in general
+Deletion of attribute references and subscriptions is passed to the
+primary object involved; deletion of a slicing is in general
equivalent to assignment of an empty slice of the right type (but even
this is determined by the sliced object).
Changed in version 3.11: Starred elements are now allowed in the
expression list.
''',
- 'formatstrings': r'''Format String Syntax
+ 'formatstrings': r'''Format string syntax
********************
The "str.format()" method and the "Formatter" class share the same
preceded by a colon "':'". These specify a non-default format for the
replacement value.
-See also the Format Specification Mini-Language section.
+See also the Format specification mini-language section.
The *field_name* itself begins with an *arg_name* that is either a
number or a keyword. If it’s a number, it refers to a positional
See the Format examples section for some examples.
-Format Specification Mini-Language
+Format specification mini-language
==================================
“Format specifications” are used within replacement fields contained
within a format string to define how individual values are presented
-(see Format String Syntax, f-strings, and t-strings). They can also be
+(see Format string syntax, f-strings, and t-strings). They can also be
passed directly to the built-in "format()" function. Each formattable
type may define how the format specification is to be interpreted.
Using type-specific formatting:
- >>> import datetime
- >>> d = datetime.datetime(2010, 7, 4, 12, 15, 58)
+ >>> import datetime as dt
+ >>> d = dt.datetime(2010, 7, 4, 12, 15, 58)
>>> '{:%Y-%m-%d %H:%M:%S}'.format(d)
'2010-07-04 12:15:58'
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"
+These sets are 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.
The *public names* defined by a module are determined by checking the
module’s namespace for a variable named "__all__"; if defined, it must
be a sequence of strings which are names defined or imported by that
-module. The names given in "__all__" are all considered public and
+module. Names containing non-ASCII characters must be in the
+normalization form NFKC; see Non-ASCII characters in names for
+details. The names given in "__all__" are all considered public and
are required to exist. If "__all__" is not defined, the set of public
names includes all names found in the module’s namespace which do not
begin with an underscore character ("'_'"). "__all__" should contain
| value...}", "{expressions...}" | list display, dictionary display, set |
| | display |
+-------------------------------------------------+---------------------------------------+
-| "x[index]", "x[index:index]", | Subscription, slicing, call, |
-| "x(arguments...)", "x.attribute" | attribute reference |
+| "x[index]", "x[index:index]" "x(arguments...)", | Subscription (including slicing), |
+| "x.attribute" | call, attribute reference |
+-------------------------------------------------+---------------------------------------+
| "await x" | Await expression |
+-------------------------------------------------+---------------------------------------+
The power operator has the same semantics as the built-in "pow()"
function, when called with two arguments: it yields its left argument
-raised to the power of its right argument. The numeric arguments are
-first converted to a common type, and the result is of that type.
+raised to the power of its right argument. Numeric arguments are first
+converted to a common type, and the result is of that type.
For int operands, the result has the same type as the operands unless
the second argument is negative; in that case, all arguments are
Added in version 3.4.
-Note:
+object.__getitem__(self, subscript)
- Slicing is done exclusively with the following three methods. A
- call like
+ Called to implement *subscription*, that is, "self[subscript]". See
+ Subscriptions and slicings for details on the syntax.
- a[1:2] = b
+ There are two types of built-in objects that support subscription
+ via "__getitem__()":
- is translated to
+ * **sequences**, where *subscript* (also called *index*) should be
+ an integer or a "slice" object. See the sequence documentation
+ for the expected behavior, including handling "slice" objects and
+ negative indices.
- a[slice(1, 2, None)] = b
+ * **mappings**, where *subscript* is also called the *key*. See
+ mapping documentation for the expected behavior.
- and so forth. Missing slice items are always filled in with "None".
+ If *subscript* is of an inappropriate type, "__getitem__()" should
+ raise "TypeError". If *subscript* has an inappropriate value,
+ "__getitem__()" should raise an "LookupError" or one of its
+ subclasses ("IndexError" for sequences; "KeyError" for mappings).
+
+ Note:
-object.__getitem__(self, key)
+ Slicing is handled by "__getitem__()", "__setitem__()", and
+ "__delitem__()". A call like
- Called to implement evaluation of "self[key]". For *sequence*
- types, the accepted keys should be integers. Optionally, they may
- support "slice" objects as well. Negative index support is also
- optional. If *key* is of an inappropriate type, "TypeError" may be
- raised; if *key* is a value outside the set of indexes for the
- sequence (after any special interpretation of negative values),
- "IndexError" should be raised. For *mapping* types, if *key* is
- missing (not in the container), "KeyError" should be raised.
+ a[1:2] = b
+
+ is translated to
+
+ a[slice(1, 2, None)] = b
+
+ and so forth. Missing slice items are always filled in with
+ "None".
Note:
- "for" loops expect that an "IndexError" will be raised for
- illegal indexes to allow proper detection of the end of the
- sequence.
+ The sequence iteration protocol (used, for example, in "for"
+ loops), expects that an "IndexError" will be raised for illegal
+ indexes to allow proper detection of the end of a sequence.
Note:
'slicings': r'''Slicings
********
-A slicing selects a range of items in a sequence object (e.g., a
-string, tuple or list). Slicings may be used as expressions or as
-targets in assignment or "del" statements. The syntax for a slicing:
-
- slicing: primary "[" slice_list "]"
- slice_list: slice_item ("," slice_item)* [","]
- slice_item: expression | proper_slice
- proper_slice: [lower_bound] ":" [upper_bound] [ ":" [stride] ]
- lower_bound: expression
- upper_bound: expression
- stride: expression
-
-There is ambiguity in the formal syntax here: anything that looks like
-an expression list also looks like a slice list, so any subscription
-can be interpreted as a slicing. Rather than further complicating the
-syntax, this is disambiguated by defining that in this case the
-interpretation as a subscription takes priority over the
-interpretation as a slicing (this is the case if the slice list
-contains no proper slice).
-
-The semantics for a slicing are as follows. The primary is indexed
-(using the same "__getitem__()" method as normal subscription) with a
-key that is constructed from the slice list, as follows. If the slice
-list contains at least one comma, the key is a tuple containing the
-conversion of the slice items; otherwise, the conversion of the lone
-slice item is the key. The conversion of a slice item that is an
-expression is that expression. The conversion of a proper slice is a
-slice object (see section The standard type hierarchy) whose "start",
-"stop" and "step" attributes are the values of the expressions given
-as lower bound, upper bound and stride, respectively, substituting
-"None" for missing expressions.
+A more advanced form of subscription, *slicing*, is commonly used to
+extract a portion of a sequence. In this form, the subscript is a
+*slice*: up to three expressions separated by colons. Any of the
+expressions may be omitted, but a slice must contain at least one
+colon:
+
+ >>> number_names = ['zero', 'one', 'two', 'three', 'four', 'five']
+ >>> number_names[1:3]
+ ['one', 'two']
+ >>> number_names[1:]
+ ['one', 'two', 'three', 'four', 'five']
+ >>> number_names[:3]
+ ['zero', 'one', 'two']
+ >>> number_names[:]
+ ['zero', 'one', 'two', 'three', 'four', 'five']
+ >>> number_names[::2]
+ ['zero', 'two', 'four']
+ >>> number_names[:-3]
+ ['zero', 'one', 'two']
+ >>> del number_names[4:]
+ >>> number_names
+ ['zero', 'one', 'two', 'three']
+
+When a slice is evaluated, the interpreter constructs a "slice" object
+whose "start", "stop" and "step" attributes, respectively, are the
+results of the expressions between the colons. Any missing expression
+evaluates to "None". This "slice" object is then passed to the
+"__getitem__()" or "__class_getitem__()" *special method*, as above.
+
+ # continuing with the SubscriptionDemo instance defined above:
+ >>> demo[2:3]
+ subscripted with: slice(2, 3, None)
+ >>> demo[::'spam']
+ subscripted with: slice(None, None, 'spam')
''',
'specialattrs': r'''Special Attributes
******************
formatting to one of the built-in types, or use a similar
formatting option syntax.
- See Format Specification Mini-Language for a description of the
+ See Format specification mini-language for a description of the
standard formatting syntax.
The return value must be a string object.
intended to provide protection against a denial-of-service caused
by carefully chosen inputs that exploit the worst case
performance of a dict insertion, *O*(*n*^2) complexity. See
- http://ocert.org/advisories/ocert-2011-003.html for
+ https://ocert.org/advisories/ocert-2011-003.html for
details.Changing hash values affects the iteration order of sets.
Python has never made guarantees about this ordering (and it
typically varies between 32-bit and 64-bit builds).See also
Added in version 3.4.
-Note:
+object.__getitem__(self, subscript)
+
+ Called to implement *subscription*, that is, "self[subscript]". See
+ Subscriptions and slicings for details on the syntax.
- Slicing is done exclusively with the following three methods. A
- call like
+ There are two types of built-in objects that support subscription
+ via "__getitem__()":
- a[1:2] = b
+ * **sequences**, where *subscript* (also called *index*) should be
+ an integer or a "slice" object. See the sequence documentation
+ for the expected behavior, including handling "slice" objects and
+ negative indices.
+
+ * **mappings**, where *subscript* is also called the *key*. See
+ mapping documentation for the expected behavior.
+
+ If *subscript* is of an inappropriate type, "__getitem__()" should
+ raise "TypeError". If *subscript* has an inappropriate value,
+ "__getitem__()" should raise an "LookupError" or one of its
+ subclasses ("IndexError" for sequences; "KeyError" for mappings).
+
+ Note:
- is translated to
+ Slicing is handled by "__getitem__()", "__setitem__()", and
+ "__delitem__()". A call like
- a[slice(1, 2, None)] = b
+ a[1:2] = b
- and so forth. Missing slice items are always filled in with "None".
+ is translated to
-object.__getitem__(self, key)
+ a[slice(1, 2, None)] = b
- Called to implement evaluation of "self[key]". For *sequence*
- types, the accepted keys should be integers. Optionally, they may
- support "slice" objects as well. Negative index support is also
- optional. If *key* is of an inappropriate type, "TypeError" may be
- raised; if *key* is a value outside the set of indexes for the
- sequence (after any special interpretation of negative values),
- "IndexError" should be raised. For *mapping* types, if *key* is
- missing (not in the container), "KeyError" should be raised.
+ and so forth. Missing slice items are always filled in with
+ "None".
Note:
- "for" loops expect that an "IndexError" will be raised for
- illegal indexes to allow proper detection of the end of the
- sequence.
+ The sequence iteration protocol (used, for example, in "for"
+ loops), expects that an "IndexError" will be raised for illegal
+ indexes to allow proper detection of the end of a sequence.
Note:
"inspect.BufferFlags" provides a convenient way to interpret the
flags. The method must return a "memoryview" object.
+ **Thread safety:** In *free-threaded* Python, implementations must
+ manage any internal export counter using atomic operations. The
+ method must be safe to call concurrently from multiple threads, and
+ the returned buffer’s underlying data must remain valid until the
+ corresponding "__release_buffer__()" call completes. See Thread
+ safety for memoryview objects for details.
+
object.__release_buffer__(self, buffer)
Called when a buffer is no longer needed. The *buffer* argument is
a "memoryview" object that was previously returned by
"__buffer__()". The method must release any resources associated
- with the buffer. This method should return "None". Buffer objects
- that do not need to perform any cleanup are not required to
- implement this method.
+ with the buffer. This method should return "None".
+
+ **Thread safety:** In *free-threaded* Python, any export counter
+ decrement must use atomic operations. Resource cleanup must be
+ thread-safe, as the final release may race with concurrent releases
+ from other threads.
+
+ Buffer objects that do not need to perform any cleanup are not
+ required to implement this method.
Added in version 3.12.
Strings also support two styles of string formatting, one providing a
large degree of flexibility and customization (see "str.format()",
-Format String Syntax and Custom String Formatting) and the other based
+Format string syntax and Custom string formatting) and the other based
on C "printf" style formatting that handles a narrower range of types
and is slightly harder to use correctly, but is often faster for the
cases it can handle (printf-style String Formatting).
>>> "{1} expects the {0} Inquisition!".format("Spanish", "Nobody")
'Nobody expects the Spanish Inquisition!'
- See Format String Syntax for a description of the various
+ See Format string syntax for a description of the various
formatting options that can be specified in format strings.
Note:
there is at least one character, "False" otherwise. A character
"c" is alphanumeric if one of the following returns "True":
"c.isalpha()", "c.isdecimal()", "c.isdigit()", or "c.isnumeric()".
+ For example:
+
+ >>> 'abc123'.isalnum()
+ True
+ >>> 'abc123!@#'.isalnum()
+ False
+ >>> ''.isalnum()
+ False
+ >>> ' '.isalnum()
+ False
str.isalpha()
>>> '\t'.isprintable(), '\n'.isprintable()
(False, False)
+ See also "isspace()".
+
str.isspace()
Return "True" if there are only whitespace characters in the string
and there is at least one character, "False" otherwise.
+ For example:
+
+ >>> ''.isspace()
+ False
+ >>> ' '.isspace()
+ True
+ >>> '\t\n'.isspace() # TAB and BREAK LINE
+ True
+ >>> '\u3000'.isspace() # IDEOGRAPHIC SPACE
+ True
+
A character is *whitespace* if in the Unicode character database
(see "unicodedata"), either its general category is "Zs"
(“Separator, space”), or its bidirectional class is one of "WS",
"B", or "S".
+ See also "isprintable()".
+
str.istitle()
Return "True" if the string is a titlecased string and there is at
found, return a 3-tuple containing the string itself, followed by
two empty strings.
+ For example:
+
+ >>> 'Monty Python'.partition(' ')
+ ('Monty', ' ', 'Python')
+ >>> "Monty Python's Flying Circus".partition(' ')
+ ('Monty', ' ', "Python's Flying Circus")
+ >>> 'Monty Python'.partition('-')
+ ('Monty Python', '', '')
+
+ See also "rpartition()".
+
str.removeprefix(prefix, /)
If the string starts with the *prefix* string, return
space). The original string is returned if *width* is less than or
equal to "len(s)".
+ For example:
+
+ >>> 'Python'.rjust(10)
+ ' Python'
+ >>> 'Python'.rjust(10, '.')
+ '....Python'
+ >>> 'Monty Python'.rjust(10, '.')
+ 'Monty Python'
+
+ See also "ljust()" and "zfill()".
+
str.rpartition(sep, /)
Split the string at the last occurrence of *sep*, and return a
*chars* argument is a string specifying the set of characters to be
removed. If omitted or "None", the *chars* argument defaults to
removing whitespace. The *chars* argument is not a suffix; rather,
- all combinations of its values are stripped:
+ all combinations of its values are stripped. For example:
>>> ' spacious '.rstrip()
' spacious'
>>> 'mississippi'.rstrip('ipz')
'mississ'
- See "str.removesuffix()" for a method that will remove a single
- suffix string rather than all of a set of characters. For example:
+ See "removesuffix()" for a method that will remove a single suffix
+ string rather than all of a set of characters. For example:
>>> 'Monty Python'.rstrip(' Python')
'M'
>>> 'Monty Python'.removesuffix(' Python')
'Monty'
+ See also "strip()".
+
str.split(sep=None, maxsplit=-1)
Return a list of the words in the string, using *sep* as the
With optional *start*, test string beginning at that position.
With optional *end*, stop comparing string at that position.
+ For example:
+
+ >>> 'Python'.startswith('Py')
+ True
+ >>> 'a tuple of prefixes'.startswith(('at', 'a'))
+ True
+ >>> 'Python is amazing'.startswith('is', 7)
+ True
+
+ See also "endswith()" and "removeprefix()".
+
str.strip(chars=None, /)
Return a copy of the string with the leading and trailing
set of characters to be removed. If omitted or "None", the *chars*
argument defaults to removing whitespace. The *chars* argument is
not a prefix or suffix; rather, all combinations of its values are
- stripped:
+ stripped.
+
+ For example:
>>> ' spacious '.strip()
'spacious'
stripped from the string. Characters are removed from the leading
end until reaching a string character that is not contained in the
set of characters in *chars*. A similar action takes place on the
- trailing end. For example:
+ trailing end.
+
+ For example:
>>> comment_string = '#....... Section 3.2.1 Issue #32 .......'
>>> comment_string.strip('.#! ')
'Section 3.2.1 Issue #32'
+ See also "rstrip()".
+
str.swapcase()
Return a copy of the string with uppercase characters converted to
'00042'
>>> "-42".zfill(5)
'-0042'
+
+ See also "rjust()".
''',
'strings': '''String and Bytes literals
*************************
<rest of the t-string grammar is omitted; see above>
''',
- 'subscriptions': r'''Subscriptions
-*************
+ 'subscriptions': r'''Subscriptions and slicings
+**************************
+
+The *subscription* syntax is usually used for selecting an element
+from a container – for example, to get a value from a "dict":
-The subscription of an instance of a container class will generally
-select an element from the container. The subscription of a *generic
-class* will generally return a GenericAlias object.
+ >>> digits_by_name = {'one': 1, 'two': 2}
+ >>> digits_by_name['two'] # Subscripting a dictionary using the key 'two'
+ 2
- subscription: primary "[" flexible_expression_list "]"
+In the subscription syntax, the object being subscribed – a primary –
+is followed by a *subscript* in square brackets. In the simplest case,
+the subscript is a single expression.
-When an object is subscripted, the interpreter will evaluate the
-primary and the expression list.
+Depending on the type of the object being subscribed, the subscript is
+sometimes called a *key* (for mappings), *index* (for sequences), or
+*type argument* (for *generic types*). Syntactically, these are all
+equivalent:
-The primary must evaluate to an object that supports subscription. An
-object may support subscription through defining one or both of
-"__getitem__()" and "__class_getitem__()". When the primary is
-subscripted, the evaluated result of the expression list will be
-passed to one of these methods. For more details on when
-"__class_getitem__" is called instead of "__getitem__", see
+ >>> colors = ['red', 'blue', 'green', 'black']
+ >>> colors[3] # Subscripting a list using the index 3
+ 'black'
+
+ >>> list[str] # Parameterizing the list type using the type argument str
+ list[str]
+
+At runtime, the interpreter will evaluate the primary and the
+subscript, and call the primary’s "__getitem__()" or
+"__class_getitem__()" *special method* with the subscript as argument.
+For more details on which of these methods is called, see
__class_getitem__ versus __getitem__.
-If the expression list contains at least one comma, or if any of the
-expressions are starred, the expression list will evaluate to a
-"tuple" containing the items of the expression list. Otherwise, the
-expression list will evaluate to the value of the list’s sole member.
-
-Changed in version 3.11: Expressions in an expression list may be
-starred. See **PEP 646**.
-
-For built-in objects, there are two types of objects that support
-subscription via "__getitem__()":
-
-1. Mappings. If the primary is a *mapping*, the expression list must
- evaluate to an object whose value is one of the keys of the
- mapping, and the subscription selects the value in the mapping that
- corresponds to that key. An example of a builtin mapping class is
- the "dict" class.
-
-2. Sequences. If the primary is a *sequence*, the expression list must
- evaluate to an "int" or a "slice" (as discussed in the following
- section). Examples of builtin sequence classes include the "str",
- "list" and "tuple" classes.
-
-The formal syntax makes no special provision for negative indices in
-*sequences*. However, built-in sequences all provide a "__getitem__()"
-method that interprets negative indices by adding the length of the
-sequence to the index so that, for example, "x[-1]" selects the last
-item of "x". The resulting value must be a nonnegative integer less
-than the number of items in the sequence, and the subscription selects
-the item whose index is that value (counting from zero). Since the
-support for negative indices and slicing occurs in the object’s
-"__getitem__()" method, subclasses overriding this method will need to
-explicitly add that support.
-
-A "string" is a special kind of sequence whose items are *characters*.
-A character is not a separate data type but a string of exactly one
-character.
+To show how subscription works, we can define a custom object that
+implements "__getitem__()" and prints out the value of the subscript:
+
+ >>> class SubscriptionDemo:
+ ... def __getitem__(self, key):
+ ... print(f'subscripted with: {key!r}')
+ ...
+ >>> demo = SubscriptionDemo()
+ >>> demo[1]
+ subscripted with: 1
+ >>> demo['a' * 3]
+ subscripted with: 'aaa'
+
+See "__getitem__()" documentation for how built-in types handle
+subscription.
+
+Subscriptions may also be used as targets in assignment or deletion
+statements. In these cases, the interpreter will call the subscripted
+object’s "__setitem__()" or "__delitem__()" *special method*,
+respectively, instead of "__getitem__()".
+
+ >>> colors = ['red', 'blue', 'green', 'black']
+ >>> colors[3] = 'white' # Setting item at index
+ >>> colors
+ ['red', 'blue', 'green', 'white']
+ >>> del colors[3] # Deleting item at index 3
+ >>> colors
+ ['red', 'blue', 'green']
+
+All advanced forms of *subscript* documented in the following sections
+are also usable for assignment and deletion.
+
+
+Slicings
+========
+
+A more advanced form of subscription, *slicing*, is commonly used to
+extract a portion of a sequence. In this form, the subscript is a
+*slice*: up to three expressions separated by colons. Any of the
+expressions may be omitted, but a slice must contain at least one
+colon:
+
+ >>> number_names = ['zero', 'one', 'two', 'three', 'four', 'five']
+ >>> number_names[1:3]
+ ['one', 'two']
+ >>> number_names[1:]
+ ['one', 'two', 'three', 'four', 'five']
+ >>> number_names[:3]
+ ['zero', 'one', 'two']
+ >>> number_names[:]
+ ['zero', 'one', 'two', 'three', 'four', 'five']
+ >>> number_names[::2]
+ ['zero', 'two', 'four']
+ >>> number_names[:-3]
+ ['zero', 'one', 'two']
+ >>> del number_names[4:]
+ >>> number_names
+ ['zero', 'one', 'two', 'three']
+
+When a slice is evaluated, the interpreter constructs a "slice" object
+whose "start", "stop" and "step" attributes, respectively, are the
+results of the expressions between the colons. Any missing expression
+evaluates to "None". This "slice" object is then passed to the
+"__getitem__()" or "__class_getitem__()" *special method*, as above.
+
+ # continuing with the SubscriptionDemo instance defined above:
+ >>> demo[2:3]
+ subscripted with: slice(2, 3, None)
+ >>> demo[::'spam']
+ subscripted with: slice(None, None, 'spam')
+
+
+Comma-separated subscripts
+==========================
+
+The subscript can also be given as two or more comma-separated
+expressions or slices:
+
+ # continuing with the SubscriptionDemo instance defined above:
+ >>> demo[1, 2, 3]
+ subscripted with: (1, 2, 3)
+ >>> demo[1:2, 3]
+ subscripted with: (slice(1, 2, None), 3)
+
+This form is commonly used with numerical libraries for slicing multi-
+dimensional data. In this case, the interpreter constructs a "tuple"
+of the results of the expressions or slices, and passes this tuple to
+the "__getitem__()" or "__class_getitem__()" *special method*, as
+above.
+
+The subscript may also be given as a single expression or slice
+followed by a comma, to specify a one-element tuple:
+
+ >>> demo['spam',]
+ subscripted with: ('spam',)
+
+
+“Starred” subscriptions
+=======================
+
+Added in version 3.11: Expressions in *tuple_slices* may be starred.
+See **PEP 646**.
+
+The subscript can also contain a starred expression. In this case, the
+interpreter unpacks the result into a tuple, and passes this tuple to
+"__getitem__()" or "__class_getitem__()":
+
+ # continuing with the SubscriptionDemo instance defined above:
+ >>> demo[*range(10)]
+ subscripted with: (0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
+
+Starred expressions may be combined with comma-separated expressions
+and slices:
+
+ >>> demo['a', 'b', *range(3), 'c']
+ subscripted with: ('a', 'b', 0, 1, 2, 'c')
+
+
+Formal subscription grammar
+===========================
+
+ subscription: primary '[' subscript ']'
+ subscript: single_subscript | tuple_subscript
+ single_subscript: proper_slice | assignment_expression
+ proper_slice: [expression] ":" [expression] [ ":" [expression] ]
+ tuple_subscript: ','.(single_subscript | starred_expression)+ [',']
+
+Recall that the "|" operator denotes ordered choice. Specifically, in
+"subscript", if both alternatives would match, the first
+("single_subscript") has priority.
''',
'truth': r'''Truth Value Testing
*******************
"a[-2]" equals "a[n-2]", the second to last item of sequence a with
length "n".
-Sequences also support slicing: "a[i:j]" selects all items with index
-*k* such that *i* "<=" *k* "<" *j*. When used as an expression, a
-slice is a sequence of the same type. The comment above about negative
-indexes also applies to negative slice positions.
+The resulting value must be a nonnegative integer less than the number
+of items in the sequence. If it is not, an "IndexError" is raised.
+
+Sequences also support slicing: "a[start:stop]" selects all items with
+index *k* such that *start* "<=" *k* "<" *stop*. When used as an
+expression, a slice is a sequence of the same type. The comment above
+about negative subscripts also applies to negative slice positions.
+Note that no error is raised if a slice position is less than zero or
+larger than the length of the sequence.
+
+If *start* is missing or "None", slicing behaves as if *start* was
+zero. If *stop* is missing or "None", slicing behaves as if *stop* was
+equal to the length of the sequence.
Some sequences also support “extended slicing” with a third “step”
parameter: "a[i:j:k]" selects all items of *a* with index *x* where "x
The following types are immutable sequences:
Strings
- A string is a sequence of values that represent Unicode code
- points. All the code points in the range "U+0000 - U+10FFFF" can be
- represented in a string. Python doesn’t have a char type; instead,
- every code point in the string is represented as a string object
- with length "1". The built-in function "ord()" converts a code
- point from its string form to an integer in the range "0 - 10FFFF";
- "chr()" converts an integer in the range "0 - 10FFFF" to the
- corresponding length "1" string object. "str.encode()" can be used
- to convert a "str" to "bytes" using the given text encoding, and
+ A string ("str") is a sequence of values that represent
+ *characters*, or more formally, *Unicode code points*. All the code
+ points in the range "0" to "0x10FFFF" can be represented in a
+ string.
+
+ Python doesn’t have a dedicated *character* type. Instead, every
+ code point in the string is represented as a string object with
+ length "1".
+
+ The built-in function "ord()" converts a code point from its string
+ form to an integer in the range "0" to "0x10FFFF"; "chr()" converts
+ an integer in the range "0" to "0x10FFFF" to the corresponding
+ length "1" string object. "str.encode()" can be used to convert a
+ "str" to "bytes" using the given text encoding, and
"bytes.decode()" can be used to achieve the opposite.
Tuples
- The items of a tuple are arbitrary Python objects. Tuples of two or
- more items are formed by comma-separated lists of expressions. A
- tuple of one item (a ‘singleton’) can be formed by affixing a comma
- to an expression (an expression by itself does not create a tuple,
- since parentheses must be usable for grouping of expressions). An
- empty tuple can be formed by an empty pair of parentheses.
+ The items of a "tuple" are arbitrary Python objects. Tuples of two
+ or more items are formed by comma-separated lists of expressions.
+ A tuple of one item (a ‘singleton’) can be formed by affixing a
+ comma to an expression (an expression by itself does not create a
+ tuple, since parentheses must be usable for grouping of
+ expressions). An empty tuple can be formed by an empty pair of
+ parentheses.
Bytes
- A bytes object is an immutable array. The items are 8-bit bytes,
+ A "bytes" object is an immutable array. The items are 8-bit bytes,
represented by integers in the range 0 <= x < 256. Bytes literals
(like "b'abc'") and the built-in "bytes()" constructor can be used
to create bytes objects. Also, bytes objects can be decoded to
socket objects (and perhaps by other functions or methods provided by
extension modules).
+File objects implement common methods, listed below, to simplify usage
+in generic code. They are expected to be With Statement Context
+Managers.
+
The objects "sys.stdin", "sys.stdout" and "sys.stderr" are initialized
to file objects corresponding to the interpreter’s standard input,
output and error streams; they are all open in text mode and therefore
follow the interface defined by the "io.TextIOBase" abstract class.
+file.read(size=-1, /)
+
+ Retrieve up to *size* data from the file. As a convenience if
+ *size* is unspecified or -1 retrieve all data available.
+
+file.write(data, /)
+
+ Store *data* to the file.
+
+file.close()
+
+ Flush any buffers and close the underlying file.
+
Internal types
==============
"types.MappingProxyType" can be used to create a read-only view of a
"dict".
+See also:
+
+ For detailed information on thread-safety guarantees for "dict"
+ objects, see Thread safety for dict objects.
+
Dictionary view objects
=======================
Return the total number of occurrences of *value* in *sequence*.
-sequence.index(value[, start[, stop])
+sequence.index(value[, start[, stop]])
Return the index of the first occurrence of *value* in *sequence*.
sequence.append(value, /)
- Append *value* to the end of the sequence This is equivalent to
+ Append *value* to the end of the sequence. This is equivalent to
writing "seq[len(seq):len(seq)] = [value]".
sequence.clear()
empty for the duration, and raises "ValueError" if it can detect
that the list has been mutated during a sort.
-Thread safety: Reading a single element from a "list" is *atomic*:
-
- lst[i] # list.__getitem__
-
-The following methods traverse the list and use *atomic* reads of each
-item to perform their function. That means that they may return
-results affected by concurrent modifications:
-
- item in lst
- lst.index(item)
- lst.count(item)
-
-All of the above methods/operations are also lock-free. They do not
-block concurrent modifications. Other operations that hold a lock will
-not block these from observing intermediate states.All other
-operations from here on block using the per-object lock.Writing a
-single item via "lst[i] = x" is safe to call from multiple threads and
-will not corrupt the list.The following operations return new objects
-and appear *atomic* to other threads:
-
- lst1 + lst2 # concatenates two lists into a new list
- x * lst # repeats lst x times into a new list
- lst.copy() # returns a shallow copy of the list
-
-Methods that only operate on a single elements with no shifting
-required are *atomic*:
-
- lst.append(x) # append to the end of the list, no shifting required
- lst.pop() # pop element from the end of the list, no shifting required
-
-The "clear()" method is also *atomic*. Other threads cannot observe
-elements being removed.The "sort()" method is not *atomic*. Other
-threads cannot observe intermediate states during sorting, but the
-list appears empty for the duration of the sort.The following
-operations may allow lock-free operations to observe intermediate
-states since they modify multiple elements in place:
-
- lst.insert(idx, item) # shifts elements
- lst.pop(idx) # idx not at the end of the list, shifts elements
- lst *= x # copies elements in place
-
-The "remove()" method may allow concurrent modifications since element
-comparison may execute arbitrary Python code (via
-"__eq__()")."extend()" is safe to call from multiple threads.
-However, its guarantees depend on the iterable passed to it. If it is
-a "list", a "tuple", a "set", a "frozenset", a "dict" or a dictionary
-view object (but not their subclasses), the "extend" operation is safe
-from concurrent modifications to the iterable. Otherwise, an iterator
-is created which can be concurrently modified by another thread. The
-same applies to inplace concatenation of a list with other iterables
-when using "lst += iterable".Similarly, assigning to a list slice with
-"lst[i:j] = iterable" is safe to call from multiple threads, but
-"iterable" is only locked when it is also a "list" (but not its
-subclasses).Operations that involve multiple accesses, as well as
-iteration, are never atomic. For example:
-
- # NOT atomic: read-modify-write
- lst[i] = lst[i] + 1
-
- # NOT atomic: check-then-act
- if lst:
- item = lst.pop()
-
- # NOT thread-safe: iteration while modifying
- for item in lst:
- process(item) # another thread may modify lst
-
-Consider external synchronization when sharing "list" instances across
-threads. See Python support for free threading for more information.
+See also:
+
+ For detailed information on thread-safety guarantees for "list"
+ objects, see Thread safety for list objects.
Tuples
sequence.append(value, /)
- Append *value* to the end of the sequence This is equivalent to
+ Append *value* to the end of the sequence. This is equivalent to
writing "seq[len(seq):len(seq)] = [value]".
sequence.clear()
is semantically equivalent to:
manager = (EXPRESSION)
- enter = type(manager).__enter__
- exit = type(manager).__exit__
- value = enter(manager)
+ enter = manager.__enter__
+ exit = manager.__exit__
+ value = enter()
hit_except = False
try:
SUITE
except:
hit_except = True
- if not exit(manager, *sys.exc_info()):
+ if not exit(*sys.exc_info()):
raise
finally:
if not hit_except:
- exit(manager, None, None, None)
+ exit(None, None, None)
+
+except that implicit special method lookup is used for "__enter__()"
+and "__exit__()".
With more than one item, the context managers are processed as if
multiple "with" statements were nested:
--- /dev/null
+.. date: 2026-03-14-17-31-39
+.. gh-issue: 145986
+.. nonce: ifSSr8
+.. release date: 2026-04-07
+.. section: Security
+
+:mod:`xml.parsers.expat`: Fixed a crash caused by unbounded C recursion when
+converting deeply nested XML content models with
+:meth:`~xml.parsers.expat.xmlparser.ElementDeclHandler`. This addresses
+:cve:`2026-4224`.
+
+..
+
+.. date: 2026-03-06-17-03-38
+.. gh-issue: 145599
+.. nonce: kchwZV
+.. section: Security
+
+Reject control characters in :class:`http.cookies.Morsel`
+:meth:`~http.cookies.Morsel.update` and
+:meth:`~http.cookies.BaseCookie.js_output`. This addresses :cve:`2026-3644`.
+
+..
+
+.. date: 2026-03-04-18-59-17
+.. gh-issue: 145506
+.. nonce: 6hwvEh
+.. section: Security
+
+Fixes :cve:`2026-2297` by ensuring that ``SourcelessFileLoader`` uses
+:func:`io.open_code` when opening ``.pyc`` files.
+
+..
+
+.. date: 2026-01-31-21-56-54
+.. gh-issue: 144370
+.. nonce: fp9m8t
+.. section: Security
+
+Disallow usage of control characters in status in :mod:`wsgiref.handlers` to
+prevent HTTP header injections. Patch by Benedikt Johannes.
+
+..
+
+.. date: 2026-01-16-12-04-49
+.. gh-issue: 143930
+.. nonce: zYC5x3
+.. section: Security
+
+Reject leading dashes in URLs passed to :func:`webbrowser.open`.
+
+..
+
+.. date: 2026-04-06-11-15-46
+.. gh-issue: 148157
+.. nonce: JFnZDn
+.. section: Core and Builtins
+
+Fix an unlikely crash when parsing an invalid type comments for function
+parameters. Found by OSS Fuzz in :oss-fuzz:`492782951`.
+
+..
+
+.. date: 2026-04-05-15-20-00
+.. gh-issue: 148144
+.. nonce: f7qA0x
+.. section: Core and Builtins
+
+Initialize ``_PyInterpreterFrame.visited`` when copying interpreter frames
+so incremental GC does not read an uninitialized byte from generator and
+frame-object copies.
+
+..
+
+.. date: 2026-03-31-01-06-35
+.. gh-issue: 146615
+.. nonce: fix-method-get
+.. section: Core and Builtins
+
+Fix a crash in :meth:`~object.__get__` for :c:expr:`METH_METHOD` descriptors
+when an invalid (non-type) object is passed as the second argument. Patch by
+Steven Sun.
+
+..
+
+.. date: 2026-03-22-19-30-00
+.. gh-issue: 146308
+.. nonce: AxnRVA
+.. section: Core and Builtins
+
+Fixed several error handling issues in the :mod:`!_remote_debugging` module,
+including safer validation of remote ``int`` objects, clearer asyncio task
+chain failures, and cache cleanup fixes that avoid leaking or double-freeing
+metadata on allocation failure. Patch by Pablo Galindo.
+
+..
+
+.. date: 2026-03-21-15-05-14
+.. gh-issue: 146128
+.. nonce: DG1Hfa
+.. section: Core and Builtins
+
+Fix a bug which could cause constant values to be partially corrupted in
+AArch64 JIT code. This issue is theoretical, and hasn't actually been
+observed in unmodified Python interpreters.
+
+..
+
+.. date: 2026-03-21-11-55-16
+.. gh-issue: 146250
+.. nonce: ahl3O2
+.. section: Core and Builtins
+
+Fixed a memory leak in :exc:`SyntaxError` when re-initializing it.
+
+..
+
+.. date: 2026-03-21-08-48-25
+.. gh-issue: 146245
+.. nonce: cqM3_4
+.. section: Core and Builtins
+
+Fixed reference leaks in :mod:`socket` when audit hooks raise exceptions in
+:func:`socket.getaddrinfo` and :meth:`!socket.sendto`.
+
+..
+
+.. date: 2026-03-20-13-55-14
+.. gh-issue: 146196
+.. nonce: Zg70Kb
+.. section: Core and Builtins
+
+Fix potential Undefined Behavior in :c:func:`PyUnicodeWriter_WriteASCII` by
+adding a zero-length check. Patch by Shamil Abdulaev.
+
+..
+
+.. date: 2026-03-20-13-07-33
+.. gh-issue: 146227
+.. nonce: MqBPEo
+.. section: Core and Builtins
+
+Fix wrong type in ``_Py_atomic_load_uint16`` in the C11 atomics backend
+(``pyatomic_std.h``), which used a 32-bit atomic load instead of 16-bit.
+Found by Mohammed Zuhaib.
+
+..
+
+.. date: 2026-03-18-18-52-00
+.. gh-issue: 146056
+.. nonce: r1tVSo
+.. section: Core and Builtins
+
+Fix :func:`repr` for lists and tuples containing ``NULL``\ s.
+
+..
+
+.. date: 2026-03-18-16-57-56
+.. gh-issue: 146092
+.. nonce: wCKFYS
+.. section: Core and Builtins
+
+Handle properly memory allocation failures on str and float opcodes. Patch
+by Victor Stinner.
+
+..
+
+.. date: 2026-03-17-00-00-00
+.. gh-issue: 146041
+.. nonce: 7799bb
+.. section: Core and Builtins
+
+Fix free-threading scaling bottleneck in :func:`sys.intern` and
+:c:func:`PyObject_SetAttr` by avoiding the interpreter-wide lock when the
+string is already interned and immortalized.
+
+..
+
+.. date: 2026-03-15-21-45-35
+.. gh-issue: 145990
+.. nonce: tmXwRB
+.. section: Core and Builtins
+
+``python --help-env`` sections are now sorted by environment variable name.
+
+..
+
+.. date: 2026-03-15-20-47-34
+.. gh-issue: 145990
+.. nonce: 14BUzw
+.. section: Core and Builtins
+
+``python --help-xoptions`` is now sorted by ``-X`` option name.
+
+..
+
+.. date: 2026-03-11-21-27-28
+.. gh-issue: 145376
+.. nonce: LfDvyw
+.. section: Core and Builtins
+
+Fix GC tracking in ``structseq.__replace__()``.
+
+..
+
+.. date: 2026-03-11-19-09-47
+.. gh-issue: 145792
+.. nonce: X5KUhc
+.. section: Core and Builtins
+
+Fix out-of-bounds access when invoking faulthandler on a CPython build
+compiled without support for VLAs.
+
+..
+
+.. date: 2026-03-11-00-13-59
+.. gh-issue: 142183
+.. nonce: 2iVhJH
+.. section: Core and Builtins
+
+Avoid a pathological case where repeated calls at a specific stack depth
+could be significantly slower.
+
+..
+
+.. date: 2026-03-10-22-38-40
+.. gh-issue: 145779
+.. nonce: 5375381d80
+.. section: Core and Builtins
+
+Improve scaling of :func:`classmethod` and :func:`staticmethod` calls in the
+free-threaded build by avoiding the descriptor ``__get__`` call.
+
+..
+
+.. date: 2026-03-10-19-00-39
+.. gh-issue: 145783
+.. nonce: dS5TM9
+.. section: Core and Builtins
+
+Fix an unlikely crash in the parser when certain errors were erroneously not
+propagated. Found by OSS Fuzz in :oss-fuzz:`491369109`.
+
+..
+
+.. date: 2026-03-10-12-52-06
+.. gh-issue: 145685
+.. nonce: 80B7gK
+.. section: Core and Builtins
+
+Improve scaling of type attribute lookups in the :term:`free-threaded build`
+by avoiding contention on the internal type lock.
+
+..
+
+.. date: 2026-03-09-18-52-03
+.. gh-issue: 145701
+.. nonce: 79KQyO
+.. section: Core and Builtins
+
+Fix :exc:`SystemError` when ``__classdict__`` or
+``__conditional_annotations__`` is in a class-scope inlined comprehension.
+Found by OSS Fuzz in :oss-fuzz:`491105000`.
+
+..
+
+.. date: 2026-03-09-00-00-00
+.. gh-issue: 145713
+.. nonce: KR6azvzI
+.. section: Core and Builtins
+
+Make :meth:`bytearray.resize` thread-safe in the free-threaded build by
+using a critical section and calling the lock-held variant of the resize
+function.
+
+..
+
+.. date: 2026-03-06-21-05-05
+.. gh-issue: 145615
+.. nonce: NKXXZgDW
+.. section: Core and Builtins
+
+Fixed a memory leak in the :term:`free-threaded build` where mimalloc pages
+could become permanently unreclaimable until the owning thread exited.
+
+..
+
+.. date: 2026-03-05-19-10-56
+.. gh-issue: 145566
+.. nonce: H4RupyYN
+.. section: Core and Builtins
+
+In the free threading build, skip the stop-the-world pause when reassigning
+``__class__`` on a newly created object.
+
+..
+
+.. date: 2026-03-01-13-37-31
+.. gh-issue: 145335
+.. nonce: e36kPJ
+.. section: Core and Builtins
+
+Fix a crash in :func:`os.pathconf` when called with ``-1`` as the path
+argument.
+
+..
+
+.. date: 2026-02-28-18-42-36
+.. gh-issue: 145036
+.. nonce: 70Kbfz
+.. section: Core and Builtins
+
+In free-threaded build, fix race condition when calling :meth:`!__sizeof__`
+on a :class:`list`
+
+..
+
+.. date: 2026-02-28-16-46-17
+.. gh-issue: 145376
+.. nonce: lG5u1a
+.. section: Core and Builtins
+
+Fix reference leaks in various unusual error scenarios.
+
+..
+
+.. date: 2026-02-26-21-36-00
+.. gh-issue: 145234
+.. nonce: w0mQ9n
+.. section: Core and Builtins
+
+Fixed a ``SystemError`` in the parser when an encoding cookie (for example,
+UTF-7) decodes to carriage returns (``\r``). Newlines are now normalized
+after decoding in the string tokenizer.
+
+Patch by Pablo Galindo.
+
+..
+
+.. date: 2026-02-26-12-00-00
+.. gh-issue: 130555
+.. nonce: TMSOIu
+.. section: Core and Builtins
+
+Fix use-after-free in :meth:`dict.clear` when the dictionary values are
+embedded in an object and a destructor causes re-entrant mutation of the
+dictionary.
+
+..
+
+.. date: 2026-02-24-18-30-56
+.. gh-issue: 145187
+.. nonce: YjPu1Z
+.. section: Core and Builtins
+
+Fix compiler assertion fail when a type parameter bound contains an invalid
+expression in a conditional block.
+
+..
+
+.. date: 2026-02-23-23-18-28
+.. gh-issue: 145142
+.. nonce: T-XbVe
+.. section: Core and Builtins
+
+Fix a crash in the free-threaded build when the dictionary argument to
+:meth:`str.maketrans` is concurrently modified.
+
+..
+
+.. date: 2026-02-16-12-28-43
+.. gh-issue: 144872
+.. nonce: k9_Q30
+.. section: Core and Builtins
+
+Fix heap buffer overflow in the parser found by OSS-Fuzz.
+
+..
+
+.. date: 2026-02-13-18-30-59
+.. gh-issue: 144766
+.. nonce: JGu3x3
+.. section: Core and Builtins
+
+Fix a crash in fork child process when perf support is enabled.
+
+..
+
+.. date: 2026-02-13-12-00-00
+.. gh-issue: 144759
+.. nonce: d3qYpe
+.. section: Core and Builtins
+
+Fix undefined behavior in the lexer when ``start`` and ``multi_line_start``
+pointers are ``NULL`` in ``_PyLexer_remember_fstring_buffers()`` and
+``_PyLexer_restore_fstring_buffers()``. The ``NULL`` pointer arithmetic
+(``NULL - valid_pointer``) is now guarded with explicit ``NULL`` checks.
+
+..
+
+.. date: 2026-02-08-18-13-38
+.. gh-issue: 144563
+.. nonce: hb3kpp
+.. section: Core and Builtins
+
+Fix interaction of the Tachyon profiler and :mod:`ctypes` and other modules
+that load the Python shared library (if present) in an independent map as
+this was causing the mechanism that loads the binary information to be
+confused. Patch by Pablo Galindo
+
+..
+
+.. date: 2026-02-08-12-47-27
+.. gh-issue: 144601
+.. nonce: E4Yi9J
+.. section: Core and Builtins
+
+Fix crash when importing a module whose ``PyInit`` function raises an
+exception from a subinterpreter.
+
+..
+
+.. date: 2026-02-06-21-45-52
+.. gh-issue: 144438
+.. nonce: GI_uB1LR
+.. section: Core and Builtins
+
+Align the QSBR thread state array to a 64-byte cache line boundary to avoid
+false sharing in the :term:`free-threaded build`.
+
+..
+
+.. date: 2026-02-05-13-30-00
+.. gh-issue: 144513
+.. nonce: IjSTd7
+.. section: Core and Builtins
+
+Fix potential deadlock when using critical sections during stop-the-world
+pauses in the free-threaded build.
+
+..
+
+.. date: 2026-02-03-17-08-13
+.. gh-issue: 144446
+.. nonce: db5619
+.. section: Core and Builtins
+
+Fix data races in the free-threaded build when reading frame object
+attributes while another thread is executing the frame.
+
+..
+
+.. date: 2026-01-10-12-59-58
+.. gh-issue: 143636
+.. nonce: dzr26e
+.. section: Core and Builtins
+
+Fix a crash when calling :class:`SimpleNamespace.__replace__()
+<types.SimpleNamespace>` on non-namespace instances. Patch by Bénédikt Tran.
+
+..
+
+.. date: 2026-01-10-10-58-36
+.. gh-issue: 143650
+.. nonce: k8mR4x
+.. section: Core and Builtins
+
+Fix race condition in :mod:`importlib` where a thread could receive a stale
+module reference when another thread's import fails.
+
+..
+
+.. 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-02-16-23-17
+.. gh-issue: 140594
+.. nonce: YIWUpl
+.. section: Core and Builtins
+
+Fix an out of bounds read when a single NUL character is read from the
+standard input. Patch by Shamil Abdulaev.
+
+..
+
+.. date: 2025-07-07-17-26-06
+.. gh-issue: 91636
+.. nonce: GyHU72
+.. section: Core and Builtins
+
+While performing garbage collection, clear weakrefs to unreachable objects
+that are created during running of finalizers. If those weakrefs were are
+not cleared, they could reveal unreachable objects.
+
+..
+
+.. date: 2025-02-19-21-06-30
+.. gh-issue: 130327
+.. nonce: z3TaR8
+.. section: Core and Builtins
+
+Fix erroneous clearing of an object's :attr:`~object.__dict__` if
+overwritten at runtime.
+
+..
+
+.. date: 2023-07-26-00-03-00
+.. gh-issue: 80667
+.. nonce: N7Dh8B
+.. section: Core and Builtins
+
+Literals using the ``\N{name}`` escape syntax can now construct CJK
+ideographs and Hangul syllables using case-insensitive names.
+
+..
+
+.. date: 2026-04-07-01-04-00
+.. gh-issue: 144503
+.. nonce: argvfs
+.. section: Library
+
+Fix a regression introduced in 3.14.3 and 3.13.12 where the
+:mod:`multiprocessing` ``forkserver`` start method would fail with
+:exc:`BrokenPipeError` when the parent process had a very large
+:data:`sys.argv`. The argv is now passed to the forkserver as separate
+command-line arguments rather than being embedded in the ``-c`` command
+string, avoiding the operating system's per-argument length limit.
+
+..
+
+.. date: 2026-04-01-11-05-36
+.. gh-issue: 146613
+.. nonce: GzjUFK
+.. section: Library
+
+:mod:`itertools`: Fix a crash in :func:`itertools.groupby` when the grouper
+iterator is concurrently mutated.
+
+..
+
+.. date: 2026-03-28-13-19-20
+.. gh-issue: 146080
+.. nonce: srN12a
+.. section: Library
+
+:mod:`ssl`: fix a crash when an SNI callback tries to use an SSL object that
+has already been garbage-collected. Patch by Bénédikt Tran.
+
+..
+
+.. date: 2026-03-28-12-20-19
+.. gh-issue: 146556
+.. nonce: Y8Eson
+.. section: Library
+
+Fix :func:`annotationlib.get_annotations` hanging indefinitely when called
+with ``eval_str=True`` on a callable that has a circular ``__wrapped__``
+chain (e.g. ``f.__wrapped__ = f``). Cycle detection using an id-based
+visited set now stops the traversal and falls back to the globals found so
+far, mirroring the approach of :func:`inspect.unwrap`.
+
+..
+
+.. date: 2026-03-28-12-05-34
+.. gh-issue: 146090
+.. nonce: wf9_ef
+.. section: Library
+
+:mod:`sqlite3`: fix a crash when :meth:`sqlite3.Connection.create_collation`
+fails with `SQLITE_BUSY <https://sqlite.org/rescode.html#busy>`__. Patch by
+Bénédikt Tran.
+
+..
+
+.. date: 2026-03-28-12-01-48
+.. gh-issue: 146090
+.. nonce: wh1qJR
+.. section: Library
+
+:mod:`sqlite3`: properly raise :exc:`MemoryError` instead of
+:exc:`SystemError` when a context callback fails to be allocated. Patch by
+Bénédikt Tran.
+
+..
+
+.. date: 2026-03-26-11-04-42
+.. gh-issue: 145633
+.. nonce: RWjlaX
+.. section: Library
+
+Fix ``struct.pack('f', float)``: use :c:func:`PyFloat_Pack4` to raise
+:exc:`OverflowError`. Patch by Sergey B Kirpichev and Victor Stinner.
+
+..
+
+.. date: 2026-03-24-03-49-50
+.. gh-issue: 146310
+.. nonce: WhlDir
+.. section: Library
+
+The :mod:`ensurepip` module no longer looks for ``pip-*.whl`` wheel packages
+in the current directory.
+
+..
+
+.. date: 2026-03-17-20-52-24
+.. gh-issue: 146083
+.. nonce: NxZa_c
+.. section: Library
+
+Update bundled `libexpat <https://libexpat.github.io/>`_ to version 2.7.5.
+
+..
+
+.. date: 2026-03-17-20-41-27
+.. gh-issue: 146076
+.. nonce: yoBNnB
+.. section: Library
+
+:mod:`zoneinfo`: fix crashes when deleting ``_weak_cache`` from a
+:class:`zoneinfo.ZoneInfo` subclass.
+
+..
+
+.. date: 2026-03-17-11-46-20
+.. gh-issue: 146054
+.. nonce: udYcqn
+.. section: Library
+
+Limit the size of :func:`encodings.search_function` cache. Found by OSS Fuzz
+in :oss-fuzz:`493449985`.
+
+..
+
+.. date: 2026-03-16-00-00-00
+.. gh-issue: 146004
+.. nonce: xOptProp
+.. section: Library
+
+All :option:`-X` options from the Python command line are now propagated to
+child processes spawned by :mod:`multiprocessing`, not just a hard-coded
+subset. This makes the behavior consistent between default "spawn" and
+"forkserver" start methods and the old "fork" start method. The options
+that were previously not propagated are: ``context_aware_warnings``,
+``cpu_count``, ``disable-remote-debug``, ``int_max_str_digits``,
+``lazy_imports``, ``no_debug_ranges``, ``pathconfig_warnings``, ``perf``,
+``perf_jit``, ``presite``, ``pycache_prefix``, ``thread_inherit_context``,
+and ``warn_default_encoding``.
+
+..
+
+.. date: 2026-03-12-21-01-48
+.. gh-issue: 145883
+.. nonce: lUvXcc
+.. section: Library
+
+:mod:`zoneinfo`: Fix heap buffer overflow reads from malformed TZif data.
+Found by OSS Fuzz, issues :oss-fuzz:`492245058` and :oss-fuzz:`492230068`.
+
+..
+
+.. date: 2026-03-10-14-57-15
+.. gh-issue: 145754
+.. nonce: YBL5Ko
+.. section: Library
+
+Request signature during mock autospec with ``FORWARDREF`` annotation
+format. This prevents runtime errors when an annotation uses a name that is
+not defined at runtime.
+
+..
+
+.. date: 2026-03-10-14-13-12
+.. gh-issue: 145750
+.. nonce: iQsTeX
+.. section: Library
+
+Avoid undefined behaviour from signed integer overflow when parsing format
+strings in the :mod:`struct` module. Found by OSS Fuzz in
+:oss-fuzz:`488466741`.
+
+..
+
+.. date: 2026-03-09-00-00-00
+.. gh-issue: 145492
+.. nonce: 457Afc
+.. section: Library
+
+Fix infinite recursion in :class:`collections.defaultdict` ``__repr__`` when
+a ``defaultdict`` contains itself. Based on analysis by KowalskiThomas in
+:gh:`145492`.
+
+..
+
+.. date: 2026-03-07-15-00-00
+.. gh-issue: 145623
+.. nonce: 2Y7LzT
+.. section: Library
+
+Fix crash in :mod:`struct` when calling :func:`repr` or ``__sizeof__()`` on
+an uninitialized :class:`struct.Struct` object created via
+``Struct.__new__()`` without calling ``__init__()``.
+
+..
+
+.. date: 2026-03-07-02-44-52
+.. gh-issue: 145616
+.. nonce: x8Mf23
+.. section: Library
+
+Detect Android sysconfig ABI correctly on 32-bit ARM Android on 64-bit ARM
+kernel
+
+..
+
+.. date: 2026-03-05-19-01-28
+.. gh-issue: 145551
+.. nonce: gItPRl
+.. section: Library
+
+Fix InvalidStateError when cancelling process created by
+:func:`asyncio.create_subprocess_exec` or
+:func:`asyncio.create_subprocess_shell`. Patch by Daan De Meyer.
+
+..
+
+.. date: 2026-03-03-23-21-40
+.. gh-issue: 145446
+.. nonce: 0c-TJX
+.. section: Library
+
+Now :mod:`functools` is safer in free-threaded build when using keywords in
+:func:`functools.partial`
+
+..
+
+.. date: 2026-03-03-11-49-44
+.. gh-issue: 145417
+.. nonce: m_HxIL
+.. section: Library
+
+:mod:`venv`: Prevent incorrect preservation of SELinux context when copying
+the ``Activate.ps1`` script. The script inherited the SELinux security
+context of the system template directory, rather than the destination
+project directory.
+
+..
+
+.. date: 2026-03-02-19-41-39
+.. gh-issue: 145376
+.. nonce: OOzSOh
+.. section: Library
+
+Fix double free and null pointer dereference in unusual error scenarios in
+:mod:`hashlib` and :mod:`hmac` modules.
+
+..
+
+.. date: 2026-02-28-00-55-00
+.. gh-issue: 145301
+.. nonce: Lk2bRl
+.. section: Library
+
+:mod:`hmac`: fix a crash when the initialization of the underlying C
+extension module fails.
+
+..
+
+.. date: 2026-02-27-19-00-26
+.. gh-issue: 145301
+.. nonce: 2Wih4b
+.. section: Library
+
+:mod:`hashlib`: fix a crash when the initialization of the underlying C
+extension module fails.
+
+..
+
+.. date: 2026-02-26-20-13-16
+.. gh-issue: 145264
+.. nonce: 4pggX_
+.. section: Library
+
+Base64 decoder (see :func:`binascii.a2b_base64`, :func:`base64.b64decode`,
+etc) no longer ignores excess data after the first padded quad in non-strict
+(default) mode. Instead, in conformance with :rfc:`4648`, section 3.3, it
+now ignores the pad character, "=", if it is present before the end of the
+encoded data.
+
+..
+
+.. date: 2026-02-23-20-52-55
+.. gh-issue: 145158
+.. nonce: vWJtxI
+.. section: Library
+
+Avoid undefined behaviour from signed integer overflow when parsing format
+strings in the :mod:`struct` module.
+
+..
+
+.. date: 2026-02-19-12-00-00
+.. gh-issue: 144984
+.. nonce: b93995c982
+.. section: Library
+
+Fix crash in :meth:`xml.parsers.expat.xmlparser.ExternalEntityParserCreate`
+when an allocation fails. The error paths could dereference NULL
+``handlers`` and double-decrement the parent parser's reference count.
+
+..
+
+.. date: 2026-02-19-10-57-40
+.. gh-issue: 88091
+.. nonce: N7qGV-
+.. section: Library
+
+Fix :func:`unicodedata.decomposition` for Hangul characters.
+
+..
+
+.. date: 2026-02-19-00-00-00
+.. gh-issue: 144986
+.. nonce: atexit-leak
+.. section: Library
+
+Fix a memory leak in :func:`atexit.register`. Patch by Shamil Abdulaev.
+
+..
+
+.. date: 2026-02-18-13-45-00
+.. gh-issue: 144777
+.. nonce: R97q0a
+.. section: Library
+
+Fix data races in :class:`io.IncrementalNewlineDecoder` in the
+:term:`free-threaded build`.
+
+..
+
+.. date: 2026-02-18-00-00-00
+.. gh-issue: 144809
+.. nonce: nYpEUx
+.. section: Library
+
+Make :class:`collections.deque` copy atomic in the :term:`free-threaded
+build`.
+
+..
+
+.. date: 2026-02-15-12-02-20
+.. gh-issue: 144835
+.. nonce: w_oS_J
+.. section: Library
+
+Added missing explanations for some parameters in :func:`glob.glob` and
+:func:`glob.iglob`.
+
+..
+
+.. date: 2026-02-15-00-00-00
+.. gh-issue: 144833
+.. nonce: TUelo1
+.. section: Library
+
+Fixed a use-after-free in :mod:`ssl` when ``SSL_new()`` returns NULL in
+``newPySSLSocket()``. The error was reported via a dangling pointer after
+the object had already been freed.
+
+..
+
+.. date: 2026-02-13-14-20-10
+.. gh-issue: 144782
+.. nonce: 0Y8TKj
+.. section: Library
+
+Fix :class:`argparse.ArgumentParser` to be :mod:`pickleable <pickle>`.
+
+..
+
+.. date: 2026-02-11-21-01-30
+.. gh-issue: 144259
+.. nonce: OAhOR8
+.. section: Library
+
+Fix inconsistent display of long multiline pasted content in the REPL.
+
+..
+
+.. date: 2026-02-10-22-05-51
+.. gh-issue: 144156
+.. nonce: UbrC7F
+.. section: Library
+
+Fix the folding of headers by the :mod:`email` library when :rfc:`2047`
+encoded words are used. Now whitespace is correctly preserved and also
+correctly added between adjacent encoded words. The latter property was
+broken by the fix for gh-92081, which mostly fixed previous failures to
+preserve whitespace.
+
+..
+
+.. date: 2026-02-10-16-56-05
+.. gh-issue: 66305
+.. nonce: PZ6GN8
+.. section: Library
+
+Fixed a hang on Windows in the :mod:`tempfile` module when trying to create
+a temporary file or subdirectory in a non-writable directory.
+
+..
+
+.. date: 2026-02-08-22-04-06
+.. gh-issue: 140814
+.. nonce: frzSpn
+.. section: Library
+
+:func:`multiprocessing.freeze_support` no longer sets the default start
+method as a side effect, which previously caused a subsequent
+:func:`multiprocessing.set_start_method` call to raise :exc:`RuntimeError`.
+
+..
+
+.. date: 2026-02-07-16-37-42
+.. gh-issue: 144475
+.. nonce: 8tFEXw
+.. section: Library
+
+Calling :func:`repr` on :func:`functools.partial` is now safer when the
+partial object's internal attributes are replaced while the string
+representation is being generated.
+
+..
+
+.. date: 2026-02-06-23-58-54
+.. gh-issue: 144538
+.. nonce: 5_OvGv
+.. section: Library
+
+Bump the version of pip bundled in ensurepip to version 26.0.1
+
+..
+
+.. date: 2026-02-05-13-16-57
+.. gh-issue: 144494
+.. nonce: SmcsR3
+.. section: Library
+
+Fix performance regression in :func:`asyncio.all_tasks` on
+:term:`free-threaded builds <free-threaded build>`. Patch by Kumar Aditya.
+
+..
+
+.. date: 2026-02-03-19-57-41
+.. gh-issue: 144316
+.. nonce: wop870
+.. section: Library
+
+Fix crash in ``_remote_debugging`` that caused ``test_external_inspection``
+to intermittently fail. Patch by Taegyun Kim.
+
+..
+
+.. date: 2026-01-31-17-15-49
+.. gh-issue: 144363
+.. nonce: X9f0sU
+.. section: Library
+
+Update bundled `libexpat <https://libexpat.github.io/>`_ to 2.7.4
+
+..
+
+.. date: 2026-01-17-08-44-25
+.. gh-issue: 143637
+.. nonce: qyPqDo
+.. section: Library
+
+Fixed a crash in socket.sendmsg() that could occur if ancillary data is
+mutated re-entrantly during argument parsing.
+
+..
+
+.. date: 2026-01-13-10-38-43
+.. gh-issue: 143543
+.. nonce: DeQRCO
+.. section: Library
+
+Fix a crash in itertools.groupby that could occur when a user-defined
+:meth:`~object.__eq__` method re-enters the iterator during key comparison.
+
+..
+
+.. date: 2026-01-12-19-39-57
+.. gh-issue: 140652
+.. nonce: HvM9Bl
+.. section: Library
+
+Fix a crash in :func:`!_interpchannels.list_all` after closing a channel.
+
+..
+
+.. date: 2026-01-11-18-35-52
+.. gh-issue: 143698
+.. nonce: gXDzsJ
+.. section: Library
+
+Allow *scheduler* and *setpgroup* arguments to be explicitly :const:`None`
+when calling :func:`os.posix_spawn` or :func:`os.posix_spawnp`. Patch by
+Bénédikt Tran.
+
+..
+
+.. date: 2026-01-11-16-59-22
+.. gh-issue: 143698
+.. nonce: b-Cpeb
+.. section: Library
+
+Raise :exc:`TypeError` instead of :exc:`SystemError` when the *scheduler* in
+:func:`os.posix_spawn` or :func:`os.posix_spawnp` is not a tuple. Patch by
+Bénédikt Tran.
+
+..
+
+.. date: 2026-01-11-13-03-32
+.. gh-issue: 142516
+.. nonce: u7An-s
+.. section: Library
+
+:mod:`ssl`: fix reference leaks in :class:`ssl.SSLContext` objects. Patch by
+Bénédikt Tran.
+
+..
+
+.. date: 2026-01-01-05-26-00
+.. gh-issue: 143304
+.. nonce: Kv7x9Q
+.. section: Library
+
+Fix :class:`ctypes.CDLL` to honor the ``handle`` parameter on POSIX systems.
+
+..
+
+.. date: 2025-12-18-00-14-16
+.. gh-issue: 142781
+.. nonce: gcOeYF
+.. section: Library
+
+:mod:`zoneinfo`: fix a crash when instantiating :class:`~zoneinfo.ZoneInfo`
+objects for which the internal class-level cache is inconsistent.
+
+..
+
+.. date: 2025-12-18-00-00-00
+.. gh-issue: 142763
+.. nonce: AJpZPVG5
+.. section: Library
+
+Fix a race condition between :class:`zoneinfo.ZoneInfo` creation and
+:func:`zoneinfo.ZoneInfo.clear_cache` that could raise :exc:`KeyError`.
+
+..
+
+.. date: 2025-12-16-13-34-48
+.. gh-issue: 142787
+.. nonce: wNitJX
+.. section: Library
+
+Fix assertion failure in :mod:`sqlite3` blob subscript when slicing with
+indices that result in an empty slice.
+
+..
+
+.. date: 2025-12-06-16-14-18
+.. gh-issue: 142352
+.. nonce: pW5HLX88
+.. section: Library
+
+Fix :meth:`asyncio.StreamWriter.start_tls` to transfer buffered data from
+:class:`~asyncio.StreamReader` to the SSL layer, preventing data loss when
+upgrading a connection to TLS mid-stream (e.g., when implementing PROXY
+protocol support).
+
+..
+
+.. date: 2025-11-18-06-35-53
+.. gh-issue: 141707
+.. nonce: DBmQIy
+.. section: Library
+
+Don't change :class:`tarfile.TarInfo` type from ``AREGTYPE`` to ``DIRTYPE``
+when parsing GNU long name or link headers.
+
+..
+
+.. date: 2025-10-11-11-50-59
+.. gh-issue: 139933
+.. nonce: 05MHlx
+.. section: Library
+
+Improve :exc:`AttributeError` suggestions for classes with a custom
+:meth:`~object.__dir__` method returning a list of unsortable values. Patch
+by Bénédikt Tran.
+
+..
+
+.. date: 2025-08-04-23-20-43
+.. gh-issue: 137335
+.. nonce: IIjDJN
+.. section: Library
+
+Get rid of any possibility of a name conflict for named pipes in
+:mod:`multiprocessing` and :mod:`asyncio` on Windows, no matter how small.
+
+..
+
+.. date: 2023-02-05-20-02-30
+.. gh-issue: 80667
+.. nonce: 7LmzeA
+.. section: Library
+
+Support lookup for Tangut Ideographs in :mod:`unicodedata`.
+
+..
+
+.. bpo: 40243
+.. date: 2020-04-10-14-29-53
+.. nonce: 85HRib
+.. section: Library
+
+Fix :meth:`!unicodedata.ucd_3_2_0.numeric` for non-decimal values.
+
+..
+
+.. date: 2026-03-25-00-00-00
+.. gh-issue: 126676
+.. nonce: 052336
+.. section: Documentation
+
+Expand :mod:`argparse` documentation for ``type=bool`` with a demonstration
+of the surprising behavior and pointers to common alternatives.
+
+..
+
+.. date: 2026-03-09-00-00-00
+.. gh-issue: 145649
+.. nonce: 8BcbAB
+.. section: Documentation
+
+Fix text wrapping and formatting of ``-X`` option descriptions in the
+:manpage:`python(1)` man page by using proper roff markup.
+
+..
+
+.. date: 2026-03-03-08-18-00
+.. gh-issue: 145450
+.. nonce: VI7GXj
+.. section: Documentation
+
+Document missing public :class:`wave.Wave_write` getter methods.
+
+..
+
+.. date: 2025-08-02-18-59-01
+.. gh-issue: 136246
+.. nonce: RIK7nE
+.. section: Documentation
+
+A new "Improve this page" link is available in the left-hand sidebar of the
+docs, offering links to create GitHub issues, discussion forum posts, or
+pull requests.
+
+..
+
+.. date: 2026-04-03-21-37-18
+.. gh-issue: 144418
+.. nonce: PusC0S
+.. section: Tests
+
+The Android testbed's emulator RAM has been increased from 2 GB to 4 GB.
+
+..
+
+.. date: 2026-03-24-00-15-58
+.. gh-issue: 146202
+.. nonce: LgH6Bj
+.. section: Tests
+
+Fix a race condition in regrtest: make sure that the temporary directory is
+created in the worker process. Previously, temp_cwd() could fail on Windows
+if the "build" directory was not created. Patch by Victor Stinner.
+
+..
+
+.. date: 2026-02-12-12-12-00
+.. gh-issue: 144739
+.. nonce: -fx1tN
+.. section: Tests
+
+When Python was compiled with system expat older then 2.7.2 but tests run
+with newer expat, still skip
+:class:`!test.test_pyexpat.MemoryProtectionTest`.
+
+..
+
+.. date: 2026-03-28-02-48-51
+.. gh-issue: 146541
+.. nonce: k-zlM6
+.. section: Build
+
+The Android testbed can now be built for 32-bit ARM and x86 targets.
+
+..
+
+.. date: 2026-03-27-06-55-10
+.. gh-issue: 146498
+.. nonce: uOiCab
+.. section: Build
+
+The iOS XCframework build script now ensures libpython isn't included in
+installed app content, and is more robust in identifying standard library
+binary content that requires processing.
+
+..
+
+.. date: 2026-03-26-14-35-29
+.. gh-issue: 146450
+.. nonce: 9Kmp5Q
+.. section: Build
+
+The Android build script was modified to improve parity with other platform
+build scripts.
+
+..
+
+.. date: 2026-03-26-12-48-42
+.. gh-issue: 146446
+.. nonce: 0GyMu4
+.. section: Build
+
+The clean target for the Apple/iOS XCframework build script is now more
+selective when targeting a single architecture.
+
+..
+
+.. date: 2026-03-11-11-58-42
+.. gh-issue: 145801
+.. nonce: iCXa3v
+.. section: Build
+
+When Python build is optimized with GCC using PGO, use
+``-fprofile-update=atomic`` option to use atomic operations when updating
+profile information. This option reduces the risk of gcov Data Files (.gcda)
+corruption which can cause random GCC crashes. Patch by Victor Stinner.
+
+..
+
+.. date: 2026-02-27-10-57-20
+.. gh-issue: 145307
+.. nonce: ueoT7j
+.. section: Windows
+
+Defers loading of the ``psapi.dll`` module until it is used by
+:func:`ctypes.util.dllist`.
+
+..
+
+.. date: 2026-02-13-11-07-51
+.. gh-issue: 144551
+.. nonce: ENtMYD
+.. section: Windows
+
+Updated bundled version of OpenSSL to 3.0.19.
+
+..
+
+.. date: 2025-10-19-23-44-46
+.. gh-issue: 140131
+.. nonce: AABF2k
+.. section: Windows
+
+Fix REPL cursor position on Windows when module completion suggestion line
+hits console width.
+
+..
+
+.. date: 2026-02-17-00-15-11
+.. gh-issue: 144551
+.. nonce: ydhtXd
+.. section: macOS
+
+Update macOS installer to use OpenSSL 3.0.19.
+
+..
+
+.. date: 2025-10-17-01-07-03
+.. gh-issue: 137586
+.. nonce: kVzxvp
+.. section: macOS
+
+Invoke :program:`osascript` with absolute path in :mod:`webbrowser` and
+:mod:`!turtledemo`.
+
+..
+
+.. date: 2026-03-18-20-18-59
+.. gh-issue: 146056
+.. nonce: nnZIgp
+.. section: C API
+
+:c:func:`PyUnicodeWriter_WriteRepr` now supports ``NULL`` argument.
+
+..
+
+.. date: 2026-02-19-18-39-11
+.. gh-issue: 145010
+.. nonce: mKzjci
+.. section: C API
+
+Use GCC dialect alternatives for inline assembly in ``object.h`` so that the
+Python headers compile correctly with ``-masm=intel``.
+
+..
+
+.. date: 2026-02-18-15-12-34
+.. gh-issue: 144981
+.. nonce: 4ZdM63
+.. section: C API
+
+Made :c:func:`PyUnstable_Code_SetExtra`, :c:func:`PyUnstable_Code_GetExtra`,
+and :c:func:`PyUnstable_Eval_RequestCodeExtraIndex` thread-safe on the
+:term:`free threaded <free threading>` build.