-# Autogenerated by Sphinx on Tue Jan 21 03:33:33 2025
+# Autogenerated by Sphinx on Tue Feb 11 19:16:18 2025
# as part of the release process.
topics = {
Assert statements are a convenient way to insert debugging assertions
into a program:
- assert_stmt ::= "assert" expression ["," expression]
+ **assert_stmt**: "assert" "expression" ["," "expression"]
The simple form, "assert expression", is equivalent to
Assignment statements are used to (re)bind names to values and to
modify attributes or items of mutable objects:
- assignment_stmt ::= (target_list "=")+ (starred_expression | yield_expression)
- target_list ::= target ("," target)* [","]
- target ::= identifier
- | "(" [target_list] ")"
- | "[" [target_list] "]"
- | attributeref
- | subscription
- | slicing
- | "*" target
+ **assignment_stmt**: ("target_list" "=")+ ("starred_expression" | "yield_expression")
+ **target_list**: "target" ("," "target")* [","]
+ **target**: "identifier"
+ | "(" ["target_list"] ")"
+ | "[" ["target_list"] "]"
+ | "attributeref"
+ | "subscription"
+ | "slicing"
+ | "*" "target"
(See section Primaries for the syntax definitions for *attributeref*,
*subscription*, and *slicing*.)
Augmented assignment is the combination, in a single statement, of a
binary operation and an assignment statement:
- augmented_assignment_stmt ::= augtarget augop (expression_list | yield_expression)
- augtarget ::= identifier | attributeref | subscription | slicing
- augop ::= "+=" | "-=" | "*=" | "@=" | "/=" | "//=" | "%=" | "**="
- | ">>=" | "<<=" | "&=" | "^=" | "|="
+ **augmented_assignment_stmt**: "augtarget" "augop" ("expression_list" | "yield_expression")
+ **augtarget**: "identifier" | "attributeref" | "subscription" | "slicing"
+ **augop**: "+=" | "-=" | "*=" | "@=" | "/=" | "//=" | "%=" | "**="
+ | ">>=" | "<<=" | "&=" | "^=" | "|="
(See section Primaries for the syntax definitions of the last three
symbols.)
a variable or attribute annotation and an optional assignment
statement:
- annotated_assignment_stmt ::= augtarget ":" expression
- ["=" (starred_expression | yield_expression)]
+ **annotated_assignment_stmt**: "augtarget" ":" "expression"
+ ["=" ("starred_expression" | "yield_expression")]
The difference from normal Assignment statements is that only a single
target is allowed.
'assignment-expressions': r'''Assignment expressions
**********************
- assignment_expression ::= [identifier ":="] expression
+ **assignment_expression**: ["identifier" ":="] "expression"
An assignment expression (sometimes also called a “named expression”
or “walrus”) assigns an "expression" to an "identifier", while also
Coroutine function definition
=============================
- async_funcdef ::= [decorators] "async" "def" funcname "(" [parameter_list] ")"
- ["->" expression] ":" suite
+ **async_funcdef**: ["decorators"] "async" "def" "funcname" "(" ["parameter_list"] ")"
+ ["->" "expression"] ":" "suite"
Execution of Python coroutines can be suspended and resumed at many
points (see *coroutine*). "await" expressions, "async for" and "async
The "async for" statement
=========================
- async_for_stmt ::= "async" for_stmt
+ **async_for_stmt**: "async" "for_stmt"
An *asynchronous iterable* provides an "__aiter__" method that
directly returns an *asynchronous iterator*, which can call
The "async with" statement
==========================
- async_with_stmt ::= "async" with_stmt
+ **async_with_stmt**: "async" "with_stmt"
An *asynchronous context manager* is a *context manager* that is able
to suspend execution in its *enter* and *exit* methods.
Python supports string and bytes literals and various numeric
literals:
- literal ::= stringliteral | bytesliteral
- | integer | floatnumber | imagnumber
+ **literal**: "stringliteral" | "bytesliteral"
+ | "integer" | "floatnumber" | "imagnumber"
Evaluation of a literal yields an object of the given type (string,
bytes, integer, floating-point number, complex number) with the given
An attribute reference is a primary followed by a period and a name:
- attributeref ::= primary "." identifier
+ **attributeref**: "primary" "." "identifier"
The primary must evaluate to an object of a type that supports
attribute references, which most objects do. This object is then
Augmented assignment is the combination, in a single statement, of a
binary operation and an assignment statement:
- augmented_assignment_stmt ::= augtarget augop (expression_list | yield_expression)
- augtarget ::= identifier | attributeref | subscription | slicing
- augop ::= "+=" | "-=" | "*=" | "@=" | "/=" | "//=" | "%=" | "**="
- | ">>=" | "<<=" | "&=" | "^=" | "|="
+ **augmented_assignment_stmt**: "augtarget" "augop" ("expression_list" | "yield_expression")
+ **augtarget**: "identifier" | "attributeref" | "subscription" | "slicing"
+ **augop**: "+=" | "-=" | "*=" | "@=" | "/=" | "//=" | "%=" | "**="
+ | ">>=" | "<<=" | "&=" | "^=" | "|="
(See section Primaries for the syntax definitions of the last three
symbols.)
Suspend the execution of *coroutine* on an *awaitable* object. Can
only be used inside a *coroutine function*.
- await_expr ::= "await" primary
+ **await_expr**: "await" "primary"
Added in version 3.5.
''',
levels, one for multiplicative operators and one for additive
operators:
- m_expr ::= u_expr | m_expr "*" u_expr | m_expr "@" m_expr |
- m_expr "//" u_expr | m_expr "/" u_expr |
- m_expr "%" u_expr
- a_expr ::= m_expr | a_expr "+" m_expr | a_expr "-" m_expr
+ **m_expr**: "u_expr" | "m_expr" "*" "u_expr" | "m_expr" "@" "m_expr" |
+ "m_expr" "//" "u_expr" | "m_expr" "/" "u_expr" |
+ "m_expr" "%" "u_expr"
+ **a_expr**: "m_expr" | "a_expr" "+" "m_expr" | "a_expr" "-" "m_expr"
The "*" (multiplication) operator yields the product of its arguments.
The arguments must either both be numbers, or one argument must be an
Each of the three bitwise operations has a different priority level:
- and_expr ::= shift_expr | and_expr "&" shift_expr
- xor_expr ::= and_expr | xor_expr "^" and_expr
- or_expr ::= xor_expr | or_expr "|" xor_expr
+ **and_expr**: "shift_expr" | "and_expr" "&" "shift_expr"
+ **xor_expr**: "and_expr" | "xor_expr" "^" "and_expr"
+ **or_expr**: "xor_expr" | "or_expr" "|" "xor_expr"
The "&" operator yields the bitwise AND of its arguments, which must
be integers or one of them must be a custom object overriding
'booleans': r'''Boolean operations
******************
- or_test ::= and_test | or_test "or" and_test
- and_test ::= not_test | and_test "and" not_test
- not_test ::= comparison | "not" not_test
+ **or_test**: "and_test" | "or_test" "or" "and_test"
+ **and_test**: "not_test" | "and_test" "and" "not_test"
+ **not_test**: "comparison" | "not" "not_test"
In the context of Boolean operations, and also when expressions are
used by control flow statements, the following values are interpreted
'break': r'''The "break" statement
*********************
- break_stmt ::= "break"
+ **break_stmt**: "break"
"break" may only occur syntactically nested in a "for" or "while"
loop, but not nested in a function or class definition within that
A call calls a callable object (e.g., a *function*) with a possibly
empty series of *arguments*:
- call ::= primary "(" [argument_list [","] | comprehension] ")"
- argument_list ::= positional_arguments ["," starred_and_keywords]
- ["," keywords_arguments]
- | starred_and_keywords ["," keywords_arguments]
- | keywords_arguments
- positional_arguments ::= positional_item ("," positional_item)*
- positional_item ::= assignment_expression | "*" expression
- starred_and_keywords ::= ("*" expression | keyword_item)
- ("," "*" expression | "," keyword_item)*
- keywords_arguments ::= (keyword_item | "**" expression)
- ("," keyword_item | "," "**" expression)*
- keyword_item ::= identifier "=" expression
+ **call**: "primary" "(" ["argument_list" [","] | "comprehension"] ")"
+ **argument_list**: "positional_arguments" ["," "starred_and_keywords"]
+ ["," "keywords_arguments"]
+ | "starred_and_keywords" ["," "keywords_arguments"]
+ | "keywords_arguments"
+ **positional_arguments**: positional_item ("," positional_item)*
+ **positional_item**: "assignment_expression" | "*" "expression"
+ **starred_and_keywords**: ("*" "expression" | "keyword_item")
+ ("," "*" "expression" | "," "keyword_item")*
+ **keywords_arguments**: ("keyword_item" | "**" "expression")
+ ("," "keyword_item" | "," "**" "expression")*
+ **keyword_item**: "identifier" "=" "expression"
An optional trailing comma may be present after the positional and
keyword arguments but does not affect the semantics.
A class definition defines a class object (see section The standard
type hierarchy):
- classdef ::= [decorators] "class" classname [type_params] [inheritance] ":" suite
- inheritance ::= "(" [argument_list] ")"
- classname ::= identifier
+ **classdef**: ["decorators"] "class" "classname" ["type_params"] ["inheritance"] ":" "suite"
+ **inheritance**: "(" ["argument_list"] ")"
+ **classname**: "identifier"
A class definition is an executable statement. The inheritance list
usually gives a list of base classes (see Metaclasses for more
operation. Also unlike C, expressions like "a < b < c" have the
interpretation that is conventional in mathematics:
- comparison ::= or_expr (comp_operator or_expr)*
- comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "!="
- | "is" ["not"] | ["not"] "in"
+ **comparison**: "or_expr" ("comp_operator" "or_expr")*
+ **comp_operator**: "<" | ">" | "==" | ">=" | "<=" | "!="
+ | "is" ["not"] | ["not"] "in"
Comparisons yield boolean values: "True" or "False". Custom *rich
comparison methods* may return non-boolean values. In this case Python
Summarizing:
- compound_stmt ::= if_stmt
- | while_stmt
- | for_stmt
- | try_stmt
- | with_stmt
- | match_stmt
- | funcdef
- | classdef
- | async_with_stmt
- | async_for_stmt
- | async_funcdef
- suite ::= stmt_list NEWLINE | NEWLINE INDENT statement+ DEDENT
- statement ::= stmt_list NEWLINE | compound_stmt
- stmt_list ::= simple_stmt (";" simple_stmt)* [";"]
+ **compound_stmt**: "if_stmt"
+ | "while_stmt"
+ | "for_stmt"
+ | "try_stmt"
+ | "with_stmt"
+ | "match_stmt"
+ | "funcdef"
+ | "classdef"
+ | "async_with_stmt"
+ | "async_for_stmt"
+ | "async_funcdef"
+ **suite**: "stmt_list" NEWLINE | NEWLINE INDENT "statement"+ DEDENT
+ **statement**: "stmt_list" NEWLINE | "compound_stmt"
+ **stmt_list**: "simple_stmt" (";" "simple_stmt")* [";"]
Note that statements always end in a "NEWLINE" possibly followed by a
"DEDENT". Also note that optional continuation clauses always begin
The "if" statement is used for conditional execution:
- if_stmt ::= "if" assignment_expression ":" suite
- ("elif" assignment_expression ":" suite)*
- ["else" ":" suite]
+ **if_stmt**: "if" "assignment_expression" ":" "suite"
+ ("elif" "assignment_expression" ":" "suite")*
+ ["else" ":" "suite"]
It selects exactly one of the suites by evaluating the expressions one
by one until one is found to be true (see section Boolean operations
The "while" statement is used for repeated execution as long as an
expression is true:
- while_stmt ::= "while" assignment_expression ":" suite
- ["else" ":" suite]
+ **while_stmt**: "while" "assignment_expression" ":" "suite"
+ ["else" ":" "suite"]
This repeatedly tests the expression and, if it is true, executes the
first suite; if the expression is false (which may be the first time
The "for" statement is used to iterate over the elements of a sequence
(such as a string, tuple or list) or other iterable object:
- for_stmt ::= "for" target_list "in" starred_list ":" suite
- ["else" ":" suite]
+ **for_stmt**: "for" "target_list" "in" "starred_list" ":" "suite"
+ ["else" ":" "suite"]
The "starred_list" expression is evaluated once; it should yield an
*iterable* object. An *iterator* is created for that iterable. The
The "try" statement specifies exception handlers and/or cleanup code
for a group of statements:
- try_stmt ::= try1_stmt | try2_stmt | try3_stmt
- try1_stmt ::= "try" ":" suite
- ("except" [expression ["as" identifier]] ":" suite)+
- ["else" ":" suite]
- ["finally" ":" suite]
- try2_stmt ::= "try" ":" suite
- ("except" "*" expression ["as" identifier] ":" suite)+
- ["else" ":" suite]
- ["finally" ":" suite]
- try3_stmt ::= "try" ":" suite
- "finally" ":" suite
+ **try_stmt**: "try1_stmt" | "try2_stmt" | "try3_stmt"
+ **try1_stmt**: "try" ":" "suite"
+ ("except" ["expression" ["as" "identifier"]] ":" "suite")+
+ ["else" ":" "suite"]
+ ["finally" ":" "suite"]
+ **try2_stmt**: "try" ":" "suite"
+ ("except" "*" "expression" ["as" "identifier"] ":" "suite")+
+ ["else" ":" "suite"]
+ ["finally" ":" "suite"]
+ **try3_stmt**: "try" ":" "suite"
+ "finally" ":" "suite"
Additional information on exceptions can be found in section
Exceptions, and information on using the "raise" statement to generate
Context Managers). This allows common "try"…"except"…"finally" usage
patterns to be encapsulated for convenient reuse.
- with_stmt ::= "with" ( "(" with_stmt_contents ","? ")" | with_stmt_contents ) ":" suite
- with_stmt_contents ::= with_item ("," with_item)*
- with_item ::= expression ["as" target]
+ **with_stmt**: "with" ( "(" "with_stmt_contents" ","? ")" | "with_stmt_contents" ) ":" "suite"
+ **with_stmt_contents**: "with_item" ("," "with_item")*
+ **with_item**: "expression" ["as" "target"]
The execution of the "with" statement with one “item” proceeds as
follows:
The match statement is used for pattern matching. Syntax:
- match_stmt ::= 'match' subject_expr ":" NEWLINE INDENT case_block+ DEDENT
- subject_expr ::= star_named_expression "," star_named_expressions?
- | named_expression
- case_block ::= 'case' patterns [guard] ":" block
+ **match_stmt**: 'match' "subject_expr" ":" NEWLINE INDENT "case_block"+ DEDENT
+ **subject_expr**: "star_named_expression" "," "star_named_expressions"?
+ | "named_expression"
+ **case_block**: 'case' "patterns" ["guard"] ":" "block"
Note:
Guards
------
- guard ::= "if" named_expression
+ **guard**: "if" "named_expression"
A "guard" (which is part of the "case") must succeed for code inside
the "case" block to execute. It takes the form: "if" followed by an
The top-level syntax for "patterns" is:
- patterns ::= open_sequence_pattern | pattern
- pattern ::= as_pattern | or_pattern
- closed_pattern ::= | literal_pattern
- | capture_pattern
- | wildcard_pattern
- | value_pattern
- | group_pattern
- | sequence_pattern
- | mapping_pattern
- | class_pattern
+ **patterns**: "open_sequence_pattern" | "pattern"
+ **pattern**: "as_pattern" | "or_pattern"
+ **closed_pattern**: | "literal_pattern"
+ | "capture_pattern"
+ | "wildcard_pattern"
+ | "value_pattern"
+ | "group_pattern"
+ | "sequence_pattern"
+ | "mapping_pattern"
+ | "class_pattern"
The descriptions below will include a description “in simple terms” of
what a pattern does for illustration purposes (credits to Raymond
An OR pattern is two or more patterns separated by vertical bars "|".
Syntax:
- or_pattern ::= "|".closed_pattern+
+ **or_pattern**: "|"."closed_pattern"+
Only the final subpattern may be irrefutable, and each subpattern must
bind the same set of names to avoid ambiguity.
An AS pattern matches an OR pattern on the left of the "as" keyword
against a subject. Syntax:
- as_pattern ::= or_pattern "as" capture_pattern
+ **as_pattern**: "or_pattern" "as" "capture_pattern"
If the OR pattern fails, the AS pattern fails. Otherwise, the AS
pattern binds the subject to the name on the right of the as keyword
A literal pattern corresponds to most literals in Python. Syntax:
- literal_pattern ::= signed_number
- | signed_number "+" NUMBER
- | signed_number "-" NUMBER
- | strings
- | "None"
- | "True"
- | "False"
- signed_number ::= ["-"] NUMBER
+ **literal_pattern**: "signed_number"
+ | "signed_number" "+" NUMBER
+ | "signed_number" "-" NUMBER
+ | "strings"
+ | "None"
+ | "True"
+ | "False"
+ **signed_number**: ["-"] NUMBER
The rule "strings" and the token "NUMBER" are defined in the standard
Python grammar. Triple-quoted strings are supported. Raw strings and
A capture pattern binds the subject value to a name. Syntax:
- capture_pattern ::= !'_' NAME
+ **capture_pattern**: !'_' NAME
A single underscore "_" is not a capture pattern (this is what "!'_'"
expresses). It is instead treated as a "wildcard_pattern".
A wildcard pattern always succeeds (matches anything) and binds no
name. Syntax:
- wildcard_pattern ::= '_'
+ **wildcard_pattern**: '_'
"_" is a soft keyword within any pattern, but only within patterns.
It is an identifier, as usual, even within "match" subject
A value pattern represents a named value in Python. Syntax:
- value_pattern ::= attr
- attr ::= name_or_attr "." NAME
- name_or_attr ::= attr | NAME
+ **value_pattern**: "attr"
+ **attr**: "name_or_attr" "." NAME
+ **name_or_attr**: "attr" | NAME
The dotted name in the pattern is looked up using standard Python name
resolution rules. The pattern succeeds if the value found compares
emphasize the intended grouping. Otherwise, it has no additional
syntax. Syntax:
- group_pattern ::= "(" pattern ")"
+ **group_pattern**: "(" "pattern" ")"
In simple terms "(P)" has the same effect as "P".
sequence elements. The syntax is similar to the unpacking of a list or
tuple.
- sequence_pattern ::= "[" [maybe_sequence_pattern] "]"
- | "(" [open_sequence_pattern] ")"
- open_sequence_pattern ::= maybe_star_pattern "," [maybe_sequence_pattern]
- maybe_sequence_pattern ::= ",".maybe_star_pattern+ ","?
- maybe_star_pattern ::= star_pattern | pattern
- star_pattern ::= "*" (capture_pattern | wildcard_pattern)
+ **sequence_pattern**: "[" ["maybe_sequence_pattern"] "]"
+ | "(" ["open_sequence_pattern"] ")"
+ **open_sequence_pattern**: "maybe_star_pattern" "," ["maybe_sequence_pattern"]
+ **maybe_sequence_pattern**: ","."maybe_star_pattern"+ ","?
+ **maybe_star_pattern**: "star_pattern" | "pattern"
+ **star_pattern**: "*" ("capture_pattern" | "wildcard_pattern")
There is no difference if parentheses or square brackets are used for
sequence patterns (i.e. "(...)" vs "[...]" ).
A mapping pattern contains one or more key-value patterns. The syntax
is similar to the construction of a dictionary. Syntax:
- mapping_pattern ::= "{" [items_pattern] "}"
- items_pattern ::= ",".key_value_pattern+ ","?
- key_value_pattern ::= (literal_pattern | value_pattern) ":" pattern
- | double_star_pattern
- double_star_pattern ::= "**" capture_pattern
+ **mapping_pattern**: "{" ["items_pattern"] "}"
+ **items_pattern**: ","."key_value_pattern"+ ","?
+ **key_value_pattern**: ("literal_pattern" | "value_pattern") ":" "pattern"
+ | "double_star_pattern"
+ **double_star_pattern**: "**" "capture_pattern"
At most one double star pattern may be in a mapping pattern. The
double star pattern must be the last subpattern in the mapping
A class pattern represents a class and its positional and keyword
arguments (if any). Syntax:
- class_pattern ::= name_or_attr "(" [pattern_arguments ","?] ")"
- pattern_arguments ::= positional_patterns ["," keyword_patterns]
- | keyword_patterns
- positional_patterns ::= ",".pattern+
- keyword_patterns ::= ",".keyword_pattern+
- keyword_pattern ::= NAME "=" pattern
+ **class_pattern**: "name_or_attr" "(" ["pattern_arguments" ","?] ")"
+ **pattern_arguments**: "positional_patterns" ["," "keyword_patterns"]
+ | "keyword_patterns"
+ **positional_patterns**: ","."pattern"+
+ **keyword_patterns**: ","."keyword_pattern"+
+ **keyword_pattern**: NAME "=" "pattern"
The same keyword should not be repeated in class patterns.
A function definition defines a user-defined function object (see
section The standard type hierarchy):
- funcdef ::= [decorators] "def" funcname [type_params] "(" [parameter_list] ")"
- ["->" expression] ":" suite
- decorators ::= decorator+
- decorator ::= "@" assignment_expression NEWLINE
- parameter_list ::= defparameter ("," defparameter)* "," "/" ["," [parameter_list_no_posonly]]
- | parameter_list_no_posonly
- parameter_list_no_posonly ::= defparameter ("," defparameter)* ["," [parameter_list_starargs]]
- | parameter_list_starargs
- parameter_list_starargs ::= "*" [star_parameter] ("," defparameter)* ["," ["**" parameter [","]]]
- | "**" parameter [","]
- parameter ::= identifier [":" expression]
- star_parameter ::= identifier [":" ["*"] expression]
- defparameter ::= parameter ["=" expression]
- funcname ::= identifier
+ **funcdef**: ["decorators"] "def" "funcname" ["type_params"] "(" ["parameter_list"] ")"
+ ["->" "expression"] ":" "suite"
+ **decorators**: "decorator"+
+ **decorator**: "@" "assignment_expression" NEWLINE
+ **parameter_list**: "defparameter" ("," "defparameter")* "," "/" ["," ["parameter_list_no_posonly"]]
+ | "parameter_list_no_posonly"
+ **parameter_list_no_posonly**: "defparameter" ("," "defparameter")* ["," ["parameter_list_starargs"]]
+ | "parameter_list_starargs"
+ **parameter_list_starargs**: "*" ["star_parameter"] ("," "defparameter")* ["," ["parameter_star_kwargs"]]
+ "*" ("," "defparameter")+ ["," ["parameter_star_kwargs"]]
+ | "parameter_star_kwargs"
+ **parameter_star_kwargs**: "**" "parameter" [","]
+ **parameter**: "identifier" [":" "expression"]
+ **star_parameter**: "identifier" [":" ["*"] "expression"]
+ **defparameter**: "parameter" ["=" "expression"]
+ **funcname**: "identifier"
A function definition is an executable statement. Its execution binds
the function name in the current local namespace to a function object
A class definition defines a class object (see section The standard
type hierarchy):
- classdef ::= [decorators] "class" classname [type_params] [inheritance] ":" suite
- inheritance ::= "(" [argument_list] ")"
- classname ::= identifier
+ **classdef**: ["decorators"] "class" "classname" ["type_params"] ["inheritance"] ":" "suite"
+ **inheritance**: "(" ["argument_list"] ")"
+ **classname**: "identifier"
A class definition is an executable statement. The inheritance list
usually gives a list of base classes (see Metaclasses for more
Coroutine function definition
-----------------------------
- async_funcdef ::= [decorators] "async" "def" funcname "(" [parameter_list] ")"
- ["->" expression] ":" suite
+ **async_funcdef**: ["decorators"] "async" "def" "funcname" "(" ["parameter_list"] ")"
+ ["->" "expression"] ":" "suite"
Execution of Python coroutines can be suspended and resumed at many
points (see *coroutine*). "await" expressions, "async for" and "async
The "async for" statement
-------------------------
- async_for_stmt ::= "async" for_stmt
+ **async_for_stmt**: "async" "for_stmt"
An *asynchronous iterable* provides an "__aiter__" method that
directly returns an *asynchronous iterator*, which can call
The "async with" statement
--------------------------
- async_with_stmt ::= "async" with_stmt
+ **async_with_stmt**: "async" "with_stmt"
An *asynchronous context manager* is a *context manager* that is able
to suspend execution in its *enter* and *exit* methods.
Changed in version 3.13: Support for default values was added (see
**PEP 696**).
- type_params ::= "[" type_param ("," type_param)* "]"
- type_param ::= typevar | typevartuple | paramspec
- typevar ::= identifier (":" expression)? ("=" expression)?
- typevartuple ::= "*" identifier ("=" expression)?
- paramspec ::= "**" identifier ("=" expression)?
+ **type_params**: "[" "type_param" ("," "type_param")* "]"
+ **type_param**: "typevar" | "typevartuple" | "paramspec"
+ **typevar**: "identifier" (":" "expression")? ("=" "expression")?
+ **typevartuple**: "*" "identifier" ("=" "expression")?
+ **paramspec**: "**" "identifier" ("=" "expression")?
Functions (including coroutines), classes and type aliases may contain
a type parameter list:
'continue': r'''The "continue" statement
************************
- continue_stmt ::= "continue"
+ **continue_stmt**: "continue"
"continue" may only occur syntactically nested in a "for" or "while"
loop, but not nested in a function or class definition within that
originate in a module that matches one of these patterns. [1]
By default, Pdb sets a handler for the SIGINT signal (which is sent
- when the user presses "Ctrl"-"C" on the console) when you give a
+ when the user presses "Ctrl-C" on the console) when you give a
"continue" command. This allows you to break into the debugger
- again by pressing "Ctrl"-"C". If you want Pdb not to touch the
+ again by pressing "Ctrl-C". If you want Pdb not to touch the
SIGINT handler, set *nosigint* to true.
The *readrc* argument defaults to true and controls whether Pdb
q(uit)
- Quit from the debugger. The program being executed is aborted.
+ Quit from the debugger. The program being executed is aborted. An
+ end-of-file input is equivalent to "quit".
+
+ A confirmation prompt will be shown if the debugger is invoked in
+ "'inline'" mode. Either "y", "Y", "<Enter>" or "EOF" will confirm
+ the quit.
+
+ Changed in version 3.14: A confirmation prompt will be shown if the
+ debugger is invoked in "'inline'" mode. After the confirmation, the
+ debugger will call "sys.exit()" immediately, instead of raising
+ "bdb.BdbQuit" in the next trace event.
debug code
'del': r'''The "del" statement
*******************
- del_stmt ::= "del" target_list
+ **del_stmt**: "del" "target_list"
Deletion is recursively defined very similar to the way assignment is
defined. Rather than spelling it out in full details, here are some
A dictionary display is a possibly empty series of dict items
(key/value pairs) enclosed in curly braces:
- dict_display ::= "{" [dict_item_list | dict_comprehension] "}"
- dict_item_list ::= dict_item ("," dict_item)* [","]
- dict_item ::= expression ":" expression | "**" or_expr
- dict_comprehension ::= expression ":" expression comp_for
+ **dict_display**: "{" ["dict_item_list" | "dict_comprehension"] "}"
+ **dict_item_list**: "dict_item" ("," "dict_item")* [","]
+ **dict_item**: "expression" ":" "expression" | "**" "or_expr"
+ **dict_comprehension**: "expression" ":" "expression" "comp_for"
A dictionary display yields a new dictionary object.
The "if" statement is used for conditional execution:
- if_stmt ::= "if" assignment_expression ":" suite
- ("elif" assignment_expression ":" suite)*
- ["else" ":" suite]
+ **if_stmt**: "if" "assignment_expression" ":" "suite"
+ ("elif" "assignment_expression" ":" "suite")*
+ ["else" ":" "suite"]
It selects exactly one of the suites by evaluating the expressions one
by one until one is found to be true (see section Boolean operations
'exprlists': r'''Expression lists
****************
- starred_expression ::= ["*"] or_expr
- flexible_expression ::= assignment_expression | starred_expression
- flexible_expression_list ::= flexible_expression ("," flexible_expression)* [","]
- starred_expression_list ::= starred_expression ("," starred_expression)* [","]
- expression_list ::= expression ("," expression)* [","]
- yield_list ::= expression_list | starred_expression "," [starred_expression_list]
+ **starred_expression**: ["*"] "or_expr"
+ **flexible_expression**: "assignment_expression" | "starred_expression"
+ **flexible_expression_list**: "flexible_expression" ("," "flexible_expression")* [","]
+ **starred_expression_list**: "starred_expression" ("," "starred_expression")* [","]
+ **expression_list**: "expression" ("," "expression")* [","]
+ **yield_list**: "expression_list" | "starred_expression" "," ["starred_expression_list"]
Except when part of a list or set display, an expression list
containing at least one comma yields a tuple. The length of the tuple
Floating-point literals are described by the following lexical
definitions:
- floatnumber ::= pointfloat | exponentfloat
- pointfloat ::= [digitpart] fraction | digitpart "."
- exponentfloat ::= (digitpart | pointfloat) exponent
- digitpart ::= digit (["_"] digit)*
- fraction ::= "." digitpart
- exponent ::= ("e" | "E") ["+" | "-"] digitpart
+ **floatnumber**: "pointfloat" | "exponentfloat"
+ **pointfloat**: ["digitpart"] "fraction" | "digitpart" "."
+ **exponentfloat**: ("digitpart" | "pointfloat") "exponent"
+ **digitpart**: "digit" (["_"] "digit")*
+ **fraction**: "." "digitpart"
+ **exponent**: ("e" | "E") ["+" | "-"] "digitpart"
Note that the integer and exponent parts are always interpreted using
radix 10. For example, "077e010" is legal, and denotes the same number
The "for" statement is used to iterate over the elements of a sequence
(such as a string, tuple or list) or other iterable object:
- for_stmt ::= "for" target_list "in" starred_list ":" suite
- ["else" ":" suite]
+ **for_stmt**: "for" "target_list" "in" "starred_list" ":" "suite"
+ ["else" ":" "suite"]
The "starred_list" expression is evaluated once; it should yield an
*iterable* object. An *iterator* is created for that iterable. The
The grammar for a replacement field is as follows:
- replacement_field ::= "{" [field_name] ["!" conversion] [":" format_spec] "}"
- field_name ::= arg_name ("." attribute_name | "[" element_index "]")*
- arg_name ::= [identifier | digit+]
- attribute_name ::= identifier
- element_index ::= digit+ | index_string
- index_string ::= <any source character except "]"> +
- conversion ::= "r" | "s" | "a"
- format_spec ::= format-spec:format_spec
+ **replacement_field**: "{" ["field_name"] ["!" "conversion"] [":" "format_spec"] "}"
+ **field_name**: "arg_name" ("." "attribute_name" | "[" "element_index" "]")*
+ **arg_name**: ["identifier" | "digit"+]
+ **attribute_name**: "identifier"
+ **element_index**: "digit"+ | "index_string"
+ **index_string**: <any source character except "]"> +
+ **conversion**: "r" | "s" | "a"
+ **format_spec**: "format-spec:format_spec"
In less formal terms, the replacement field can start with a
*field_name* that specifies the object whose value is to be formatted
The general form of a *standard format specifier* is:
- format_spec ::= [[fill]align][sign]["z"]["#"]["0"][width][grouping_option]["." precision][type]
- fill ::= <any character>
- align ::= "<" | ">" | "=" | "^"
- sign ::= "+" | "-" | " "
- width ::= digit+
- grouping_option ::= "_" | ","
- precision ::= digit+
- type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%"
+ **format_spec**: [["fill"]"align"]["sign"]["z"]["#"]["0"]["width"]["grouping_option"]["." "precision"]["type"]
+ **fill**: <any character>
+ **align**: "<" | ">" | "=" | "^"
+ **sign**: "+" | "-" | " "
+ **width**: "digit"+
+ **grouping_option**: "_" | ","
+ **precision**: "digit"+
+ **type**: "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%"
If a valid *align* value is specified, it can be preceded by a *fill*
character that can be any character and defaults to a space if
3232235521
>>>
>>> width = 5
- >>> for num in range(5,12):
+ >>> for num in range(5,12):
... for base in 'dXob':
... print('{0:{width}{base}}'.format(num, base=base, width=width), end=' ')
... print()
A function definition defines a user-defined function object (see
section The standard type hierarchy):
- funcdef ::= [decorators] "def" funcname [type_params] "(" [parameter_list] ")"
- ["->" expression] ":" suite
- decorators ::= decorator+
- decorator ::= "@" assignment_expression NEWLINE
- parameter_list ::= defparameter ("," defparameter)* "," "/" ["," [parameter_list_no_posonly]]
- | parameter_list_no_posonly
- parameter_list_no_posonly ::= defparameter ("," defparameter)* ["," [parameter_list_starargs]]
- | parameter_list_starargs
- parameter_list_starargs ::= "*" [star_parameter] ("," defparameter)* ["," ["**" parameter [","]]]
- | "**" parameter [","]
- parameter ::= identifier [":" expression]
- star_parameter ::= identifier [":" ["*"] expression]
- defparameter ::= parameter ["=" expression]
- funcname ::= identifier
+ **funcdef**: ["decorators"] "def" "funcname" ["type_params"] "(" ["parameter_list"] ")"
+ ["->" "expression"] ":" "suite"
+ **decorators**: "decorator"+
+ **decorator**: "@" "assignment_expression" NEWLINE
+ **parameter_list**: "defparameter" ("," "defparameter")* "," "/" ["," ["parameter_list_no_posonly"]]
+ | "parameter_list_no_posonly"
+ **parameter_list_no_posonly**: "defparameter" ("," "defparameter")* ["," ["parameter_list_starargs"]]
+ | "parameter_list_starargs"
+ **parameter_list_starargs**: "*" ["star_parameter"] ("," "defparameter")* ["," ["parameter_star_kwargs"]]
+ "*" ("," "defparameter")+ ["," ["parameter_star_kwargs"]]
+ | "parameter_star_kwargs"
+ **parameter_star_kwargs**: "**" "parameter" [","]
+ **parameter**: "identifier" [":" "expression"]
+ **star_parameter**: "identifier" [":" ["*"] "expression"]
+ **defparameter**: "parameter" ["=" "expression"]
+ **funcname**: "identifier"
A function definition is an executable statement. Its execution binds
the function name in the current local namespace to a function object
'global': r'''The "global" statement
**********************
- global_stmt ::= "global" identifier ("," identifier)*
+ **global_stmt**: "global" "identifier" ("," "identifier")*
The "global" statement causes the listed identifiers to be interpreted
as globals. It would be impossible to assign to a global variable
Identifiers are unlimited in length. Case is significant.
- identifier ::= xid_start xid_continue*
- id_start ::= <all characters in general categories Lu, Ll, Lt, Lm, Lo, Nl, the underscore, and characters with the Other_ID_Start property>
- id_continue ::= <all characters in id_start, plus characters in the categories Mn, Mc, Nd, Pc and others with the Other_ID_Continue property>
- 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**: "xid_start" "xid_continue"*
+ **id_start**: <all characters in general categories Lu, Ll, Lt, Lm, Lo, Nl, the underscore, and characters with the Other_ID_Start property>
+ **id_continue**: <all characters in "id_start", plus characters in the categories Mn, Mc, Nd, Pc and others with the Other_ID_Continue property>
+ **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*">
The Unicode category codes mentioned above stand for:
The "if" statement is used for conditional execution:
- if_stmt ::= "if" assignment_expression ":" suite
- ("elif" assignment_expression ":" suite)*
- ["else" ":" suite]
+ **if_stmt**: "if" "assignment_expression" ":" "suite"
+ ("elif" "assignment_expression" ":" "suite")*
+ ["else" ":" "suite"]
It selects exactly one of the suites by evaluating the expressions one
by one until one is found to be true (see section Boolean operations
Imaginary literals are described by the following lexical definitions:
- imagnumber ::= (floatnumber | digitpart) ("j" | "J")
+ **imagnumber**: ("floatnumber" | "digitpart") ("j" | "J")
An imaginary literal yields a complex number with a real part of 0.0.
Complex numbers are represented as a pair of floating-point numbers
'import': r'''The "import" statement
**********************
- import_stmt ::= "import" module ["as" identifier] ("," module ["as" identifier])*
- | "from" relative_module "import" identifier ["as" identifier]
- ("," identifier ["as" identifier])*
- | "from" relative_module "import" "(" identifier ["as" identifier]
- ("," identifier ["as" identifier])* [","] ")"
- | "from" relative_module "import" "*"
- module ::= (identifier ".")* identifier
- relative_module ::= "."* module | "."+
+ **import_stmt**: "import" "module" ["as" "identifier"] ("," "module" ["as" "identifier"])*
+ | "from" "relative_module" "import" "identifier" ["as" "identifier"]
+ ("," "identifier" ["as" "identifier"])*
+ | "from" "relative_module" "import" "(" "identifier" ["as" "identifier"]
+ ("," "identifier" ["as" "identifier"])* [","] ")"
+ | "from" "relative_module" "import" "*"
+ **module**: ("identifier" ".")* "identifier"
+ **relative_module**: "."* "module" | "."+
The basic import statement (no "from" clause) is executed in two
steps:
allows use of the new features on a per-module basis before the
release in which the feature becomes standard.
- future_stmt ::= "from" "__future__" "import" feature ["as" identifier]
- ("," feature ["as" identifier])*
- | "from" "__future__" "import" "(" feature ["as" identifier]
- ("," feature ["as" identifier])* [","] ")"
- feature ::= identifier
+ **future_stmt**: "from" "__future__" "import" "feature" ["as" "identifier"]
+ ("," "feature" ["as" "identifier"])*
+ | "from" "__future__" "import" "(" "feature" ["as" "identifier"]
+ ("," "feature" ["as" "identifier"])* [","] ")"
+ **feature**: "identifier"
A future statement must appear near the top of the module. The only
lines that can appear before a future statement are:
Integer literals are described by the following lexical definitions:
- integer ::= decinteger | bininteger | octinteger | hexinteger
- decinteger ::= nonzerodigit (["_"] digit)* | "0"+ (["_"] "0")*
- bininteger ::= "0" ("b" | "B") (["_"] bindigit)+
- octinteger ::= "0" ("o" | "O") (["_"] octdigit)+
- hexinteger ::= "0" ("x" | "X") (["_"] hexdigit)+
- nonzerodigit ::= "1"..."9"
- digit ::= "0"..."9"
- bindigit ::= "0" | "1"
- octdigit ::= "0"..."7"
- hexdigit ::= digit | "a"..."f" | "A"..."F"
+ **integer**: "decinteger" | "bininteger" | "octinteger" | "hexinteger"
+ **decinteger**: "nonzerodigit" (["_"] "digit")* | "0"+ (["_"] "0")*
+ **bininteger**: "0" ("b" | "B") (["_"] "bindigit")+
+ **octinteger**: "0" ("o" | "O") (["_"] "octdigit")+
+ **hexinteger**: "0" ("x" | "X") (["_"] "hexdigit")+
+ **nonzerodigit**: "1"..."9"
+ **digit**: "0"..."9"
+ **bindigit**: "0" | "1"
+ **octdigit**: "0"..."7"
+ **hexdigit**: "digit" | "a"..."f" | "A"..."F"
There is no limit for the length of integer literals apart from what
can be stored in available memory.
'lambda': r'''Lambdas
*******
- lambda_expr ::= "lambda" [parameter_list] ":" expression
+ **lambda_expr**: "lambda" ["parameter_list"] ":" "expression"
Lambda expressions (sometimes called lambda forms) are used to create
anonymous functions. The expression "lambda parameters: expression"
A list display is a possibly empty series of expressions enclosed in
square brackets:
- list_display ::= "[" [flexible_expression_list | comprehension] "]"
+ **list_display**: "[" ["flexible_expression_list" | "comprehension"] "]"
A list display yields a new list object, the contents being specified
by either a list of expressions or a comprehension. When a comma-
'nonlocal': r'''The "nonlocal" statement
************************
- nonlocal_stmt ::= "nonlocal" identifier ("," identifier)*
+ **nonlocal_stmt**: "nonlocal" "identifier" ("," "identifier")*
When the definition of a function or class is nested (enclosed) within
the definitions of other functions, its nonlocal scopes are the local
'pass': r'''The "pass" statement
********************
- pass_stmt ::= "pass"
+ **pass_stmt**: "pass"
"pass" is a null operation — when it is executed, nothing happens. It
is useful as a placeholder when a statement is required syntactically,
left; it binds less tightly than unary operators on its right. The
syntax is:
- power ::= (await_expr | primary) ["**" u_expr]
+ **power**: ("await_expr" | "primary") ["**" "u_expr"]
Thus, in an unparenthesized sequence of power and unary operators, the
operators are evaluated from right to left (this does not constrain
'raise': r'''The "raise" statement
*********************
- raise_stmt ::= "raise" [expression ["from" expression]]
+ **raise_stmt**: "raise" ["expression" ["from" "expression"]]
If no expressions are present, "raise" re-raises the exception that is
currently being handled, which is also known as the *active
'return': r'''The "return" statement
**********************
- return_stmt ::= "return" [expression_list]
+ **return_stmt**: "return" ["expression_list"]
"return" may only occur syntactically nested in a function definition,
not within a nested class definition.
The shifting operations have lower priority than the arithmetic
operations:
- shift_expr ::= a_expr | shift_expr ("<<" | ">>") a_expr
+ **shift_expr**: "a_expr" | "shift_expr" ("<<" | ">>") "a_expr"
These operators accept integers as arguments. They shift the first
argument to the left or right by the number of bits given by the
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
+ **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
String literals are described by the following lexical definitions:
- stringliteral ::= [stringprefix](shortstring | longstring)
- stringprefix ::= "r" | "u" | "R" | "U" | "f" | "F"
+ **stringliteral**: ["stringprefix"]("shortstring" | "longstring")
+ **stringprefix**: "r" | "u" | "R" | "U" | "f" | "F"
| "fr" | "Fr" | "fR" | "FR" | "rf" | "rF" | "Rf" | "RF"
- shortstring ::= "'" shortstringitem* "'" | '"' shortstringitem* '"'
- longstring ::= "\'\'\'" longstringitem* "\'\'\'" | '"""' longstringitem* '"""'
- shortstringitem ::= shortstringchar | stringescapeseq
- longstringitem ::= longstringchar | stringescapeseq
- shortstringchar ::= <any source character except "\\" or newline or the quote>
- longstringchar ::= <any source character except "\\">
- stringescapeseq ::= "\\" <any source character>
-
- bytesliteral ::= bytesprefix(shortbytes | longbytes)
- bytesprefix ::= "b" | "B" | "br" | "Br" | "bR" | "BR" | "rb" | "rB" | "Rb" | "RB"
- shortbytes ::= "'" shortbytesitem* "'" | '"' shortbytesitem* '"'
- longbytes ::= "\'\'\'" longbytesitem* "\'\'\'" | '"""' longbytesitem* '"""'
- shortbytesitem ::= shortbyteschar | bytesescapeseq
- longbytesitem ::= longbyteschar | bytesescapeseq
- shortbyteschar ::= <any ASCII character except "\\" or newline or the quote>
- longbyteschar ::= <any ASCII character except "\\">
- bytesescapeseq ::= "\\" <any ASCII character>
+ **shortstring**: "'" "shortstringitem"* "'" | '"' "shortstringitem"* '"'
+ **longstring**: "\'\'\'" "longstringitem"* "\'\'\'" | '"""' "longstringitem"* '"""'
+ **shortstringitem**: "shortstringchar" | "stringescapeseq"
+ **longstringitem**: "longstringchar" | "stringescapeseq"
+ **shortstringchar**: <any source character except "\\" or newline or the quote>
+ **longstringchar**: <any source character except "\\">
+ **stringescapeseq**: "\\" <any source character>
+
+ **bytesliteral**: "bytesprefix"("shortbytes" | "longbytes")
+ **bytesprefix**: "b" | "B" | "br" | "Br" | "bR" | "BR" | "rb" | "rB" | "Rb" | "RB"
+ **shortbytes**: "'" "shortbytesitem"* "'" | '"' "shortbytesitem"* '"'
+ **longbytes**: "\'\'\'" "longbytesitem"* "\'\'\'" | '"""' "longbytesitem"* '"""'
+ **shortbytesitem**: "shortbyteschar" | "bytesescapeseq"
+ **longbytesitem**: "longbyteschar" | "bytesescapeseq"
+ **shortbyteschar**: <any ASCII character except "\\" or newline or the quote>
+ **longbyteschar**: <any ASCII character except "\\">
+ **bytesescapeseq**: "\\" <any ASCII character>
One syntactic restriction not indicated by these productions is that
whitespace is not allowed between the "stringprefix" or "bytesprefix"
select an element from the container. The subscription of a *generic
class* will generally return a GenericAlias object.
- subscription ::= primary "[" flexible_expression_list "]"
+ **subscription**: "primary" "[" "flexible_expression_list" "]"
When an object is subscripted, the interpreter will evaluate the
primary and the expression list.
The "try" statement specifies exception handlers and/or cleanup code
for a group of statements:
- try_stmt ::= try1_stmt | try2_stmt | try3_stmt
- try1_stmt ::= "try" ":" suite
- ("except" [expression ["as" identifier]] ":" suite)+
- ["else" ":" suite]
- ["finally" ":" suite]
- try2_stmt ::= "try" ":" suite
- ("except" "*" expression ["as" identifier] ":" suite)+
- ["else" ":" suite]
- ["finally" ":" suite]
- try3_stmt ::= "try" ":" suite
- "finally" ":" suite
+ **try_stmt**: "try1_stmt" | "try2_stmt" | "try3_stmt"
+ **try1_stmt**: "try" ":" "suite"
+ ("except" ["expression" ["as" "identifier"]] ":" "suite")+
+ ["else" ":" "suite"]
+ ["finally" ":" "suite"]
+ **try2_stmt**: "try" ":" "suite"
+ ("except" "*" "expression" ["as" "identifier"] ":" "suite")+
+ ["else" ":" "suite"]
+ ["finally" ":" "suite"]
+ **try3_stmt**: "try" ":" "suite"
+ "finally" ":" "suite"
Additional information on exceptions can be found in section
Exceptions, and information on using the "raise" statement to generate
All unary arithmetic and bitwise operations have the same priority:
- u_expr ::= power | "-" u_expr | "+" u_expr | "~" u_expr
+ **u_expr**: "power" | "-" "u_expr" | "+" "u_expr" | "~" "u_expr"
The unary "-" (minus) operator yields the negation of its numeric
argument; the operation can be overridden with the "__neg__()" special
The "while" statement is used for repeated execution as long as an
expression is true:
- while_stmt ::= "while" assignment_expression ":" suite
- ["else" ":" suite]
+ **while_stmt**: "while" "assignment_expression" ":" "suite"
+ ["else" ":" "suite"]
This repeatedly tests the expression and, if it is true, executes the
first suite; if the expression is false (which may be the first time
Context Managers). This allows common "try"…"except"…"finally" usage
patterns to be encapsulated for convenient reuse.
- with_stmt ::= "with" ( "(" with_stmt_contents ","? ")" | with_stmt_contents ) ":" suite
- with_stmt_contents ::= with_item ("," with_item)*
- with_item ::= expression ["as" target]
+ **with_stmt**: "with" ( "(" "with_stmt_contents" ","? ")" | "with_stmt_contents" ) ":" "suite"
+ **with_stmt_contents**: "with_item" ("," "with_item")*
+ **with_item**: "expression" ["as" "target"]
The execution of the "with" statement with one “item” proceeds as
follows:
'yield': r'''The "yield" statement
*********************
- yield_stmt ::= yield_expression
+ **yield_stmt**: "yield_expression"
A "yield" statement is semantically equivalent to a yield expression.
The "yield" statement can be used to omit the parentheses that would
--- /dev/null
+.. date: 2025-02-10-22-08-37
+.. gh-issue: 91132
+.. nonce: 00x1MI
+.. release date: 2025-02-11
+.. section: macOS
+
+Update macOS installer to use ncurses 6.5.
+
+..
+
+.. date: 2025-01-24-14-49-40
+.. gh-issue: 129248
+.. nonce: JAapG2
+.. section: Tools/Demos
+
+The iOS test runner now strips the log prefix from each line output by the
+test suite.
+
+..
+
+.. date: 2023-05-11-23-32-25
+.. gh-issue: 104400
+.. nonce: 23vxm7
+.. section: Tools/Demos
+
+Fix several bugs in extraction by switching to an AST parser in
+:program:`pygettext`.
+
+..
+
+.. date: 2025-01-30-13-09-27
+.. gh-issue: 129386
+.. nonce: iNtbEi
+.. section: Tests
+
+Add ``test.support.reset_code``, which can be used to reset various
+bytecode-level optimizations and local instrumentation for a function.
+
+..
+
+.. date: 2025-01-04-02-41-41
+.. gh-issue: 128474
+.. nonce: 0b-tl4
+.. section: Tests
+
+Disable ``test_embed`` test cases that segfault on BOLT instrument binaries.
+The tests are only disabled when BOLT is enabled.
+
+..
+
+.. date: 2024-12-16-19-15-10
+.. gh-issue: 128003
+.. nonce: GVBrfa
+.. section: Tests
+
+Add an option ``--parallel-threads=N`` to the regression test runner that
+runs individual tests in multiple threads in parallel in order to find
+concurrency bugs. Note that most of the test suite is not yet reviewed for
+thread-safety or annotated with ``@thread_unsafe`` when necessary.
+
+..
+
+.. date: 2025-01-28-14-08-03
+.. gh-issue: 105704
+.. nonce: EnhHxu
+.. section: Security
+
+When using :func:`urllib.parse.urlsplit` and :func:`urllib.parse.urlparse`
+host parsing would not reject domain names containing square brackets (``[``
+and ``]``). Square brackets are only valid for IPv6 and IPvFuture hosts
+according to `RFC 3986 Section 3.2.2
+<https://www.rfc-editor.org/rfc/rfc3986#section-3.2.2>`__.
+
+..
+
+.. date: 2024-10-29-09-15-10
+.. gh-issue: 126108
+.. nonce: eTIjHY
+.. section: Security
+
+Fix a possible ``NULL`` pointer dereference in
+:c:func:`!PySys_AddWarnOptionUnicode`.
+
+..
+
+.. date: 2024-08-06-11-43-08
+.. gh-issue: 80222
+.. nonce: wfR4BU
+.. section: Security
+
+Fix bug in the folding of quoted strings when flattening an email message
+using a modern email policy. Previously when a quoted string was folded so
+that it spanned more than one line, the surrounding quotes and internal
+escapes would be omitted. This could theoretically be used to spoof header
+lines using a carefully constructed quoted string if the resulting rendered
+email was transmitted or re-parsed.
+
+..
+
+.. date: 2024-05-24-21-00-52
+.. gh-issue: 119511
+.. nonce: jKrXQ8
+.. section: Security
+
+Fix a potential denial of service in the :mod:`imaplib` module. When
+connecting to a malicious server, it could cause an arbitrary amount of
+memory to be allocated. On many systems this is harmless as unused virtual
+memory is only a mapping, but if this hit a virtual address size limit it
+could lead to a :exc:`MemoryError` or other process crash. On unusual
+systems or builds where all allocated memory is touched and backed by actual
+ram or storage it could've consumed resources doing so until similarly
+crashing.
+
+..
+
+.. date: 2025-02-10-14-34-34
+.. gh-issue: 129939
+.. nonce: B08L4e
+.. section: Library
+
+Comparison pages with highlighted changes generated by the
+:class:`difflib.HtmlDiff` class now support dark mode.
+
+..
+
+.. date: 2025-02-10-08-44-11
+.. gh-issue: 129928
+.. nonce: QuiZEz
+.. section: Library
+
+Raise :exc:`sqlite3.ProgrammingError` if a user-defined SQL function with
+invalid number of parameters is created. Patch by Erlend Aasland.
+
+..
+
+.. date: 2025-02-09-17-47-01
+.. gh-issue: 129583
+.. nonce: -130Ys
+.. section: Library
+
+Update bundled pip to 25.0.1
+
+..
+
+.. date: 2025-02-07-10-34-09
+.. gh-issue: 129766
+.. nonce: 6n5fQZ
+.. section: Library
+
+Fix crash in :mod:`warnings`, when calling ``_release_lock()`` with no
+existing lock.
+
+..
+
+.. date: 2025-02-05-13-19-15
+.. gh-issue: 129005
+.. nonce: Sb69L_
+.. section: Library
+
+``_pyio.FileIO.readall()`` now allocates, resizes, and fills a data buffer
+using the same algorithm ``_io.FileIO.readall()`` uses.
+
+..
+
+.. date: 2025-02-04-15-16-33
+.. gh-issue: 129646
+.. nonce: sapk1F
+.. section: Library
+
+Update the locale alias mapping in the :mod:`locale` module to match the
+latest X Org locale alias mapping and support new locales in Glibc 2.41.
+
+..
+
+.. date: 2025-02-03-22-31-43
+.. gh-issue: 128317
+.. nonce: n2Swnh
+.. section: Library
+
+Put CLI calendar highlighting in private class, removing ``highlight_day``
+from public :class:`calendar.TextCalendar` API. Patch by Hugo van Kemenade.
+
+..
+
+.. date: 2025-02-03-01-43-16
+.. gh-issue: 129603
+.. nonce: xge9Tx
+.. section: Library
+
+Fix bugs where :class:`sqlite3.Row` objects could segfault if their
+inherited :attr:`~sqlite3.Cursor.description` was set to ``None``. Patch by
+Erlend Aasland.
+
+..
+
+.. date: 2025-02-01-14-55-33
+.. gh-issue: 129559
+.. nonce: hQCeAz
+.. section: Library
+
+Add :meth:`bytearray.resize` method so :class:`bytearray` can be efficiently
+resized in place.
+
+..
+
+.. date: 2025-01-31-11-14-05
+.. gh-issue: 129502
+.. nonce: j_ArNo
+.. section: Library
+
+Unlikely errors in preparing arguments for :mod:`ctypes` callback are now
+handled in the same way as errors raised in the callback of in converting
+the result of the callback -- using :func:`sys.unraisablehook` instead of
+:func:`sys.excepthook` and not setting :data:`sys.last_exc` and other
+variables.
+
+..
+
+.. date: 2025-01-29-17-10-00
+.. gh-issue: 129403
+.. nonce: 314159
+.. section: Library
+
+Corrected :exc:`ValueError` message for :class:`asyncio.Barrier` and
+:class:`threading.Barrier`.
+
+..
+
+.. date: 2025-01-29-14-30-54
+.. gh-issue: 129409
+.. nonce: JZbOE6
+.. section: Library
+
+Fix an integer overflow in the :mod:`csv` module when writing a data field
+larger than 2GB.
+
+..
+
+.. date: 2025-01-29-13-37-18
+.. gh-issue: 126400
+.. nonce: DaBaR3
+.. section: Library
+
+Add a socket *timeout* keyword argument to
+:class:`logging.handlers.SysLogHandler`.
+
+..
+
+.. date: 2025-01-29-11-14-20
+.. gh-issue: 118761
+.. nonce: gMZwE1
+.. section: Library
+
+Always lazy import ``warnings`` in :mod:`threading`. Patch by Taneli
+Hukkinen.
+
+..
+
+.. date: 2025-01-29-10-53-32
+.. gh-issue: 118761
+.. nonce: i8wjpV
+.. section: Library
+
+Improve import time of :mod:`subprocess` by lazy importing ``locale`` and
+``signal``. Patch by Taneli Hukkinen.
+
+..
+
+.. date: 2025-01-27-14-05-19
+.. gh-issue: 129346
+.. nonce: gZRd3g
+.. section: Library
+
+In :mod:`sqlite3`, handle out-of-memory when creating user-defined SQL
+functions.
+
+..
+
+.. date: 2025-01-26-10-01-21
+.. gh-issue: 129005
+.. nonce: ncpLvw
+.. section: Library
+
+Optimize ``_pyio.FileIO.readinto`` by avoiding unnecessary objects and
+copies using :func:`os.readinto`.
+
+..
+
+.. date: 2025-01-24-10-48-32
+.. gh-issue: 129195
+.. nonce: 89d5NU
+.. section: Library
+
+Support reporting call graph information from
+:func:`!asyncio.staggered.staggered_race`.
+
+..
+
+.. date: 2025-01-22-16-54-25
+.. gh-issue: 129205
+.. nonce: FMqrUt
+.. section: Library
+
+Add :func:`os.readinto` to read into a :ref:`buffer object <bufferobjects>`
+from a file descriptor.
+
+..
+
+.. date: 2025-01-22-13-29-06
+.. gh-issue: 128772
+.. nonce: 6YrxYM
+.. section: Library
+
+Fix :mod:`pydoc` for methods with the ``__module__`` attribute equal to
+``None``.
+
+..
+
+.. date: 2025-01-21-18-52-32
+.. gh-issue: 129061
+.. nonce: 4idD_B
+.. section: Library
+
+Fix FORCE_COLOR and NO_COLOR when empty strings. Patch by Hugo van Kemenade.
+
+..
+
+.. date: 2025-01-20-20-59-26
+.. gh-issue: 92897
+.. nonce: G0xH8o
+.. section: Library
+
+Scheduled the deprecation of the ``check_home`` argument of
+:func:`sysconfig.is_python_build` to Python 3.15.
+
+..
+
+.. date: 2025-01-20-16-02-38
+.. gh-issue: 129064
+.. nonce: JXasgJ
+.. section: Library
+
+Deprecate :func:`!sysconfig.expand_makefile_vars`, in favor of using
+:func:`sysconfig.get_paths` with the ``vars`` argument.
+
+..
+
+.. date: 2025-01-20-13-12-39
+.. gh-issue: 128550
+.. nonce: AJ5TOL
+.. section: Library
+
+Removed an incorrect optimization relating to eager tasks in
+:class:`asyncio.TaskGroup` that resulted in cancellations being missed.
+
+..
+
+.. date: 2025-01-18-16-58-10
+.. gh-issue: 128991
+.. nonce: EzJit9
+.. section: Library
+
+Release the enter frame reference within :mod:`bdb` callback
+
+..
+
+.. date: 2025-01-18-11-24-02
+.. gh-issue: 118761
+.. nonce: G8MmxY
+.. section: Library
+
+Reduce import time of :mod:`pstats` and :mod:`zipfile` by up to 20%, by
+removing unnecessary imports to :mod:`typing`. Patch by Bénédikt Tran.
+
+..
+
+.. date: 2025-01-18-11-04-44
+.. gh-issue: 128978
+.. nonce: hwg7-w
+.. section: Library
+
+Fix a :exc:`NameError` in :func:`!sysconfig.expand_makefile_vars`. Patch by
+Bénédikt Tran.
+
+..
+
+.. date: 2025-01-17-21-33-11
+.. gh-issue: 128961
+.. nonce: XwvyIZ
+.. section: Library
+
+Fix a crash when setting state on an exhausted :class:`array.array`
+iterator.
+
+..
+
+.. date: 2025-01-17-17-20-51
+.. gh-issue: 128894
+.. nonce: gX1-8J
+.. section: Library
+
+Fix ``traceback.TracebackException._format_syntax_error`` not to fail on
+exceptions with custom metadata.
+
+..
+
+.. date: 2025-01-17-11-46-16
+.. gh-issue: 128916
+.. nonce: GEePbO
+.. section: Library
+
+Do not attempt to set ``SO_REUSEPORT`` on sockets of address families other
+than ``AF_INET`` and ``AF_INET6``, as it is meaningless with these address
+families, and the call with fail with Linux kernel 6.12.9 and newer.
+
+..
+
+.. date: 2025-01-16-10-06-40
+.. gh-issue: 118761
+.. nonce: z100LC
+.. section: Library
+
+Improve import time of :mod:`tomllib` by removing ``typing``, ``string``,
+and ``tomllib._types`` imports. Patch by Taneli Hukkinen.
+
+..
+
+.. date: 2025-01-15-21-41-51
+.. gh-issue: 128679
+.. nonce: tq10F2
+.. section: Library
+
+:mod:`tracemalloc`: Fix race conditions when :func:`tracemalloc.stop` is
+called by a thread, while other threads are tracing memory allocations.
+Patch by Victor Stinner.
+
+..
+
+.. date: 2025-01-15-19-32-23
+.. gh-issue: 128891
+.. nonce: ojUxKo
+.. section: Library
+
+Add specialized opcodes to ``opcode.opname``.
+
+..
+
+.. date: 2025-01-15-19-16-50
+.. gh-issue: 118761
+.. nonce: cbW2ZL
+.. section: Library
+
+Reduce import time of :mod:`gettext` by up to ten times, by importing
+:mod:`re` on demand. In particular, ``re`` is no longer implicitly exposed
+as ``gettext.re``. Patch by Eli Schwartz.
+
+..
+
+.. date: 2025-01-15-18-54-48
+.. gh-issue: 118761
+.. nonce: G1dv6E
+.. section: Library
+
+Reduce the import time of :mod:`optparse` when no help text is printed.
+Patch by Eli Schwartz.
+
+..
+
+.. date: 2025-01-15-15-45-21
+.. gh-issue: 128657
+.. nonce: P5LNQA
+.. section: Library
+
+Fix possible extra reference when using objects returned by
+:func:`hashlib.sha256` under :term:`free threading`.
+
+..
+
+.. date: 2025-01-15-09-45-43
+.. gh-issue: 118761
+.. nonce: TvAC8E
+.. section: Library
+
+Reduce the import time of :mod:`csv` by up to five times, by importing
+:mod:`re` on demand. In particular, ``re`` is no more implicitly exposed as
+``csv.re``. Patch by Bénédikt Tran.
+
+..
+
+.. date: 2025-01-13-07-54-32
+.. gh-issue: 128308
+.. nonce: kYSDRF
+.. section: Library
+
+Support the *name* keyword argument for eager tasks in
+:func:`asyncio.loop.create_task`, :func:`asyncio.create_task` and
+:func:`asyncio.TaskGroup.create_task`, by passing on all *kwargs* to the
+task factory set by :func:`asyncio.loop.set_task_factory`.
+
+..
+
+.. date: 2025-01-10-13-06-54
+.. gh-issue: 118761
+.. nonce: f8oADD
+.. section: Library
+
+Improve the performance of :func:`base64.b16decode` by up to ten times by
+more efficiently checking the byte-string for hexadecimal digits. Reduce the
+import time of :mod:`base64` by up to six times, by no longer importing
+:mod:`re`. Patch by Bénédikt Tran, Chris Markiewicz, and Adam Turner.
+
+..
+
+.. date: 2025-01-09-16-20-34
+.. gh-issue: 128156
+.. nonce: GfObBq
+.. section: Library
+
+When using macOS system ``libffi``, support for complex types in
+:mod:`ctypes` is now checked at runtime (macOS 10.15 or newer). The types
+must also be available at build time.
+
+..
+
+.. date: 2025-01-08-22-30-38
+.. gh-issue: 128636
+.. nonce: jQfWXj
+.. section: Library
+
+Fix PyREPL failure when :data:`os.environ` is overwritten with an invalid
+value.
+
+..
+
+.. date: 2025-01-07-21-48-32
+.. gh-issue: 128498
+.. nonce: n6jtlW
+.. section: Library
+
+Default to stdout isatty for color detection instead of stderr. Patch by
+Hugo van Kemenade.
+
+..
+
+.. date: 2025-01-06-10-37-27
+.. gh-issue: 128384
+.. nonce: V0xzwH
+.. section: Library
+
+Add locking to :mod:`warnings` to avoid some data races when free-threading
+is used. Change ``_warnings_runtime_state.mutex`` to be a recursive mutex
+and expose it to :mod:`warnings`, via the :func:`!_acquire_lock` and
+:func:`!_release_lock` functions. The lock is held when ``filters`` and
+``_filters_version`` are updated.
+
+..
+
+.. date: 2025-01-04-20-51-48
+.. gh-issue: 128509
+.. nonce: 3gr_-O
+.. section: Library
+
+Add :func:`sys._is_immortal` for identifying :term:`immortal` objects at
+runtime.
+
+..
+
+.. date: 2025-01-04-11-10-04
+.. gh-issue: 128479
+.. nonce: jvOrF-
+.. section: Library
+
+Fix :func:`!asyncio.staggered.staggered_race` leaking tasks and issuing an
+unhandled exception.
+
+..
+
+.. date: 2025-01-02-20-34-04
+.. gh-issue: 128427
+.. nonce: onPoQZ
+.. section: Library
+
+:const:`uuid.NIL` and :const:`uuid.MAX` are now available to represent the
+Nil and Max UUID formats as defined by :rfc:`9562`.
+
+..
+
+.. date: 2024-12-30-19-53-14
+.. gh-issue: 91279
+.. nonce: EeOJk1
+.. section: Library
+
+:meth:`zipfile.ZipFile.writestr` now respect ``SOURCE_DATE_EPOCH`` that
+distributions can set centrally and have build tools consume this in order
+to produce reproducible output.
+
+..
+
+.. date: 2024-12-26-11-00-03
+.. gh-issue: 112064
+.. nonce: mCcw3B
+.. section: Library
+
+Fix incorrect handling of negative read sizes in :meth:`HTTPResponse.read
+<http.client.HTTPResponse.read>`. Patch by Yury Manushkin.
+
+..
+
+.. date: 2024-12-23-02-09-44
+.. gh-issue: 58956
+.. nonce: 4OdMdT
+.. section: Library
+
+Fixed a frame reference leak in :mod:`bdb`.
+
+..
+
+.. date: 2024-12-21-03-20-12
+.. gh-issue: 128131
+.. nonce: QpPmNt
+.. section: Library
+
+Completely support random access of uncompressed unencrypted read-only zip
+files obtained by :meth:`ZipFile.open <zipfile.ZipFile.open>`.
+
+..
+
+.. date: 2024-12-20-08-44-12
+.. gh-issue: 127975
+.. nonce: 8HJwu9
+.. section: Library
+
+Avoid reusing quote types in :func:`ast.unparse` if not needed.
+
+..
+
+.. date: 2024-12-17-16-48-02
+.. gh-issue: 115514
+.. nonce: 1yOJ7T
+.. section: Library
+
+Fix exceptions and incomplete writes after
+:class:`!asyncio._SelectorTransport` is closed before writes are completed.
+
+..
+
+.. date: 2024-12-16-22-20-38
+.. gh-issue: 121604
+.. nonce: m3Xn4G
+.. section: Library
+
+Add missing Deprecation warnings for
+:const:`importlib.machinery.DEBUG_BYTECODE_SUFFIXES`,
+:const:`importlib.machinery.OPTIMIZED_BYTECODE_SUFFIXES`,
+:class:`importlib.machinery.WindowsRegistryFinder`,
+:class:`importlib.abc.ResourceLoader`,
+:meth:`importlib.abc.SourceLoader.path_mtime`.
+
+..
+
+.. date: 2024-12-12-18-25-50
+.. gh-issue: 127873
+.. nonce: WJRwfz
+.. section: Library
+
+When ``-E`` is set, only ignore ``PYTHON_COLORS`` and not
+``FORCE_COLOR``/``NO_COLOR``/``TERM`` when colourising output. Patch by Hugo
+van Kemenade.
+
+..
+
+.. date: 2024-12-10-19-39-35
+.. gh-issue: 125413
+.. nonce: wOb4yr
+.. section: Library
+
+Add :attr:`pathlib.Path.info` attribute, which stores an object implementing
+the :class:`pathlib.types.PathInfo` protocol (also new). The object supports
+querying the file type and internally caching :func:`~os.stat` results. Path
+objects generated by :meth:`~pathlib.Path.iterdir` are initialized with file
+type information gleaned from scanning the parent directory.
+
+..
+
+.. date: 2024-12-07-20-33-43
+.. gh-issue: 127712
+.. nonce: Uzsij4
+.. section: Library
+
+Fix handling of the ``secure`` argument of
+:class:`logging.handlers.SMTPHandler`.
+
+..
+
+.. date: 2024-11-24-22-06-42
+.. gh-issue: 127096
+.. nonce: R7LLpQ
+.. section: Library
+
+Do not recreate unnamed section on every read in
+:class:`configparser.ConfigParser`. Patch by Andrey Efremov.
+
+..
+
+.. date: 2024-11-23-21-17-28
+.. gh-issue: 124369
+.. nonce: Z0hQFQ
+.. section: Library
+
+Deprecate ``pdb.Pdb.curframe_locals``
+
+..
+
+.. date: 2024-11-10-19-45-01
+.. gh-issue: 126332
+.. nonce: WCCKoH
+.. section: Library
+
+Fix _pyrepl crash when entering a double CTRL-Z on an overflowing line.
+
+..
+
+.. date: 2024-10-26-16-59-02
+.. gh-issue: 125553
+.. nonce: 4pDLzt
+.. section: Library
+
+Fix round-trip invariance for backslash continuations in
+:func:`tokenize.untokenize`.
+
+..
+
+.. date: 2024-10-02-11-17-23
+.. gh-issue: 91048
+.. nonce: QWY-b1
+.. section: Library
+
+Add :func:`asyncio.capture_call_graph` and :func:`asyncio.print_call_graph`
+functions.
+
+..
+
+.. date: 2024-09-27-19-21-53
+.. gh-issue: 124703
+.. nonce: lYTLEv
+.. section: Library
+
+Quitting :mod:`pdb` in ``inline`` mode will emit a confirmation prompt and
+exit gracefully now, instead of printing an exception traceback.
+
+..
+
+.. date: 2024-09-12-14-24-25
+.. gh-issue: 123987
+.. nonce: 7_OD1p
+.. section: Library
+
+Fixed issue in NamespaceReader where a non-path item in a namespace path,
+such as a sentinel added by an editable installer, would break resource
+loading.
+
+..
+
+.. date: 2024-08-12-11-58-15
+.. gh-issue: 119349
+.. nonce: -xTnHl
+.. section: Library
+
+Add the :func:`ctypes.util.dllist` function to list the loaded shared
+libraries for the current process.
+
+..
+
+.. date: 2024-08-01-01-00-00
+.. gh-issue: 55454
+.. nonce: wy0vGw
+.. section: Library
+
+Add IMAP4 ``IDLE`` support to the :mod:`imaplib` module. Patch by Forest.
+
+..
+
+.. date: 2024-07-14-23-19-20
+.. gh-issue: 119257
+.. nonce: 9OEzcN
+.. section: Library
+
+Show tab completions menu below the current line, which results in less
+janky behaviour, and fixes a cursor movement bug. Patch by Daniel Hollas
+
+..
+
+.. date: 2023-02-01-16-41-31
+.. gh-issue: 101410
+.. nonce: Dt2aQE
+.. section: Library
+
+Support custom messages for domain errors in the :mod:`math` module
+(:func:`math.sqrt`, :func:`math.log` and :func:`math.atanh` were modified as
+examples). Patch by Charlie Zhao and Sergey B Kirpichev.
+
+..
+
+.. date: 2022-05-23-21-23-29
+.. gh-issue: 81340
+.. nonce: D11RkZ
+.. section: Library
+
+Use :func:`os.copy_file_range` in :func:`shutil.copy`, :func:`shutil.copy2`,
+and :func:`shutil.copyfile` functions by default. An underlying Linux system
+call gives filesystems an opportunity to implement the use of copy-on-write
+(in case of btrfs and XFS) or server-side copy (in the case of NFS.) Patch
+by Illia Volochii.
+
+..
+
+.. bpo: 27307
+.. date: 2020-08-07-16-55-57
+.. nonce: Xqzzda
+.. section: Library
+
+Add attribute and item access support to :class:`string.Formatter` in
+auto-numbering mode, which allows format strings like '{.name}' and '{[1]}'.
+
+..
+
+.. date: 2025-02-08-23-42-24
+.. gh-issue: 129873
+.. nonce: -gofkd
+.. section: IDLE
+
+Simplify displaying the IDLE doc by only copying the text section of
+idle.html to idlelib/help.html. Patch by Stan Ulbrych.
+
+..
+
+.. date: 2025-01-16-18-59-11
+.. gh-issue: 125722
+.. nonce: eHHRga
+.. section: Documentation
+
+Require Sphinx 8.1.3 or later to build the Python documentation. Patch by
+Adam Turner.
+
+..
+
+.. date: 2025-01-14-11-06-41
+.. gh-issue: 67206
+.. nonce: LYKmi5
+.. section: Documentation
+
+Document that :const:`string.printable` is not printable in the POSIX sense.
+In particular, :meth:`string.printable.isprintable() <str.isprintable>`
+returns :const:`False`. Patch by Bénédikt Tran.
+
+..
+
+.. date: 2025-02-07-17-06-39
+.. gh-issue: 100239
+.. nonce: WvBTPL
+.. section: Core and Builtins
+
+Replace the opcode BINARY_SUBSCR and its family by BINARY_OP with oparg
+NB_SUBSCR.
+
+..
+
+.. date: 2025-02-06-17-57-33
+.. gh-issue: 129732
+.. nonce: yl97oq
+.. section: Core and Builtins
+
+Fixed a race in ``_Py_qsbr_reserve`` in the free threading build.
+
+..
+
+.. date: 2025-02-06-17-05-09
+.. gh-issue: 129763
+.. nonce: 6ZxQ8W
+.. section: Core and Builtins
+
+Remove the internal ``LLTRACE`` macro (use :c:macro:`Py_DEBUG` instead).
+
+..
+
+.. date: 2025-02-05-22-58-18
+.. gh-issue: 129715
+.. nonce: mLlpIO
+.. section: Core and Builtins
+
+Improve JIT performance for generators.
+
+..
+
+.. date: 2025-02-05-11-29-52
+.. gh-issue: 129643
+.. nonce: 4mGzvg
+.. section: Core and Builtins
+
+Fix thread safety of :c:func:`PyList_Insert` in free-threading builds.
+
+..
+
+.. date: 2025-02-04-21-26-05
+.. gh-issue: 129668
+.. nonce: zDanyM
+.. section: Core and Builtins
+
+Fix race condition when raising :exc:`MemoryError` in the free threaded
+build.
+
+..
+
+.. date: 2025-02-04-12-42-40
+.. gh-issue: 129643
+.. nonce: K24Zow
+.. section: Core and Builtins
+
+Fix thread safety of :c:func:`PyList_SetItem` in free-threading builds.
+Patch by Kumar Aditya.
+
+..
+
+.. date: 2025-01-28-11-13-41
+.. gh-issue: 128563
+.. nonce: xElppE
+.. section: Core and Builtins
+
+Fix an issue where the "lltrace" debug feature could have been incorrectly
+enabled for some frames.
+
+..
+
+.. date: 2025-01-28-10-26-04
+.. gh-issue: 129393
+.. nonce: 0eICq6
+.. section: Core and Builtins
+
+On FreeBSD, :data:`sys.platform` doesn't contain the major version anymore.
+It is always ``'freebsd'``, instead of ``'freebsd13'`` or ``'freebsd14'``.
+
+..
+
+.. date: 2025-01-28-06-23-59
+.. gh-issue: 129345
+.. nonce: uOjkML
+.. section: Core and Builtins
+
+Fix null pointer dereference in :func:`syslog.openlog` when an audit hook
+raises an exception.
+
+..
+
+.. date: 2025-01-24-11-37-22
+.. gh-issue: 129231
+.. nonce: ZsAP9v
+.. section: Core and Builtins
+
+Improve memory layout of JIT traces. Patch by Diego Russo
+
+..
+
+.. date: 2025-01-22-14-24-44
+.. gh-issue: 129149
+.. nonce: wAYu43
+.. section: Core and Builtins
+
+Add fast path for medium-size integers in :c:func:`PyLong_FromUnsignedLong`,
+:c:func:`PyLong_FromUnsignedLongLong` and :c:func:`PyLong_FromSize_t`.
+
+..
+
+.. date: 2025-01-22-14-22-34
+.. gh-issue: 129201
+.. nonce: wiZzEb
+.. section: Core and Builtins
+
+The free-threaded version of the cyclic garbage collector has been optimized
+to conditionally use CPU prefetch instructions during the collection. This
+can reduce collection times by making it more likely that data is in the CPU
+cache when it is needed. The prefetch instructions are enabled if the
+number of long-lived objects (objects surviving a full collection) exceeds a
+threshold.
+
+..
+
+.. date: 2025-01-21-23-35-41
+.. gh-issue: 129093
+.. nonce: 0rvETC
+.. section: Core and Builtins
+
+Fix f-strings such as ``f'{expr=}'`` sometimes not displaying the full
+expression when the expression contains ``!=``.
+
+..
+
+.. date: 2025-01-21-19-48-30
+.. gh-issue: 124363
+.. nonce: vOFhHW
+.. section: Core and Builtins
+
+Treat debug expressions in f-string as raw strings. Patch by Pablo Galindo
+
+..
+
+.. date: 2025-01-19-09-07-44
+.. gh-issue: 128714
+.. nonce: m1fyCB
+.. section: Core and Builtins
+
+Fix the potential races in get/set dunder methods ``__annotations__``,
+``__annotate__`` and ``__type_params__`` for function object, and add
+related tests.
+
+..
+
+.. date: 2025-01-18-01-06-58
+.. gh-issue: 128799
+.. nonce: vSNagk
+.. section: Core and Builtins
+
+Add frame of ``except*`` to traceback when it wraps a naked exception.
+
+..
+
+.. date: 2025-01-17-13-16-14
+.. gh-issue: 128842
+.. nonce: OMs5X6
+.. section: Core and Builtins
+
+Collect JIT memory stats using pystats. Patch by Diego Russo.
+
+..
+
+.. date: 2025-01-16-22-54-12
+.. gh-issue: 100239
+.. nonce: 7_HpBU
+.. section: Core and Builtins
+
+Specialize ``BINARY_OP`` for bitwise logical operations on compact ints.
+
+..
+
+.. date: 2025-01-16-18-16-18
+.. gh-issue: 128910
+.. nonce: 9pqfab
+.. section: Core and Builtins
+
+Undocumented and unused private C-API functions ``_PyTrash_begin`` and
+``_PyTrash_end`` are removed.
+
+..
+
+.. date: 2025-01-13-17-03-49
+.. gh-issue: 128807
+.. nonce: BGGBxD
+.. section: Core and Builtins
+
+Add a marking phase to the free-threaded GC. This is similar to what was
+done in GH-126491. Since the free-threaded GC does not have generations and
+is not incremental, the marking phase looks for all objects reachable from
+known roots. The roots are objects known to not be garbage, like the module
+dictionary for :mod:`sys`. For most programs, this marking phase should
+make the GC a bit faster since typically less work is done per object.
+
+..
+
+.. date: 2025-01-10-23-54-16
+.. gh-issue: 100239
+.. nonce: ijOOUs
+.. section: Core and Builtins
+
+Add opcode ``BINARY_OP_EXTEND`` which executes a pair of functions (guard
+and specialization functions) accessed from the inline cache.
+
+..
+
+.. date: 2025-01-10-18-56-20
+.. gh-issue: 128563
+.. nonce: baDvls
+.. section: Core and Builtins
+
+A new type of interpreter has been added to CPython. This interpreter uses
+tail calls for its instruction handlers. Preliminary benchmark results
+suggest 7-11% geometric mean faster on pyperformance (depending on
+platform), and up to 30% faster on Python-intensive workloads. This
+interpreter currently only works on newer compilers, such as ``clang-19``.
+Other compilers will continue using the old interpreter. Patch by Ken Jin,
+with ideas on how to implement this in CPython by Mark Shannon, Garret Gu,
+Haoran Xu, and Josh Haberman.
+
+..
+
+.. date: 2025-01-07-19-26-40
+.. gh-issue: 126703
+.. nonce: 9i-S5t
+.. section: Core and Builtins
+
+Improve performance of iterating over lists and tuples by using a freelist
+for the iterator objects.
+
+..
+
+.. date: 2024-12-30-15-49-31
+.. gh-issue: 127953
+.. nonce: B4_6L9
+.. section: Core and Builtins
+
+The time to handle a ``LINE`` event in sys.monitoring (and sys.settrace) is
+now independent of the number of lines in the code object.
+
+..
+
+.. date: 2024-12-29-15-09-21
+.. gh-issue: 128330
+.. nonce: IaYL7G
+.. section: Core and Builtins
+
+Restore terminal control characters on REPL exit.
+
+..
+
+.. date: 2024-12-17-09-28-17
+.. gh-issue: 128016
+.. nonce: DPqhah
+.. section: Core and Builtins
+
+Improved the ``SyntaxWarning`` message for invalid escape sequences to
+clarify that such sequences will raise a ``SyntaxError`` in future Python
+releases. The new message also suggests a potential fix, i.e., ``Did you
+mean "\\e"?``.
+
+..
+
+.. date: 2024-12-06-11-32-58
+.. gh-issue: 126004
+.. nonce: CYAwTB
+.. section: Core and Builtins
+
+Fix handling of :attr:`UnicodeError.start` and :attr:`UnicodeError.end`
+values in the :func:`codecs.replace_errors` error handler. Patch by Bénédikt
+Tran.
+
+..
+
+.. date: 2024-12-06-11-30-58
+.. gh-issue: 126004
+.. nonce: -p8MAS
+.. section: Core and Builtins
+
+Fix handling of :attr:`UnicodeError.start` and :attr:`UnicodeError.end`
+values in the :func:`codecs.backslashreplace_errors` error handler. Patch by
+Bénédikt Tran.
+
+..
+
+.. date: 2024-12-06-11-17-46
+.. gh-issue: 126004
+.. nonce: -p8MAS
+.. section: Core and Builtins
+
+Fix handling of :attr:`UnicodeError.start` and :attr:`UnicodeError.end`
+values in the :func:`codecs.xmlcharrefreplace_errors` error handler. Patch
+by Bénédikt Tran.
+
+..
+
+.. date: 2024-12-04-22-14-40
+.. gh-issue: 127119
+.. nonce: _hpyFE
+.. section: Core and Builtins
+
+Slightly optimize the :class:`int` deallocator.
+
+..
+
+.. date: 2024-11-30-16-13-31
+.. gh-issue: 127349
+.. nonce: ssYd6n
+.. section: Core and Builtins
+
+Fixed the error when resizing terminal in Python REPL. Patch by Semyon
+Moroz.
+
+..
+
+.. date: 2024-11-18-12-17-45
+.. gh-issue: 125723
+.. nonce: tW_hFG
+.. section: Core and Builtins
+
+Fix crash with ``gi_frame.f_locals`` when generator frames outlive their
+generator. Patch by Mikhail Efimov.
+
+..
+
+.. date: 2024-11-03-06-05-16
+.. gh-issue: 126349
+.. nonce: 7YwWsI
+.. section: Core and Builtins
+
+Add :func:`turtle.fill`, :func:`turtle.poly` and :func:`turtle.no_animation`
+context managers. Patch by Marie Roald and Yngve Mardal Moe.
+
+..
+
+.. date: 2024-02-29-16-55-52
+.. gh-issue: 115911
+.. nonce: Vnkue_
+.. section: Core and Builtins
+
+If the current working directory cannot be determined due to permissions,
+then import will no longer raise :exc:`PermissionError`. Patch by Alex
+Willmer.
+
+..
+
+.. date: 2023-12-04-15-53-25
+.. gh-issue: 112713
+.. nonce: Zrhv77
+.. section: Core and Builtins
+
+Added support for the ``Partitioned`` cookie flag in :mod:`http.cookies`.
+
+..
+
+.. date: 2025-02-02-12-58-21
+.. gh-issue: 129533
+.. nonce: dFfqkT
+.. section: C API
+
+Update :c:func:`PyGC_Enable()`, :c:func:`PyGC_Disable()`,
+:c:func:`PyGC_IsEnabled()` to use atomic operation for thread-safety at
+free-threading build. Patch by Donghee Na.
+
+..
+
+.. date: 2025-01-29-11-58-38
+.. gh-issue: 89188
+.. nonce: BsfLr3
+.. section: C API
+
+Implement :c:func:`PyUnicode_KIND` and :c:func:`PyUnicode_DATA` as function,
+in addition to the macros with the same names. The macros rely on C bit
+fields which have compiler-specific layout. Patch by Victor Stinner.
+
+..
+
+.. date: 2025-01-28-13-21-17
+.. gh-issue: 91417
+.. nonce: AfiR0t
+.. section: C API
+
+Remove :c:func:`PySequence_Fast` from the limited C API, since this function
+has to be used with :c:macro:`PySequence_Fast_GET_ITEM` which never worked
+in the limited C API. Patch by Victor Stinner.
+
+..
+
+.. date: 2025-01-22-09-28-04
+.. gh-issue: 128509
+.. nonce: gqQ36L
+.. section: C API
+
+Add :c:func:`PyUnstable_IsImmortal` for determining whether an object is
+:term:`immortal`.
+
+..
+
+.. date: 2025-01-20-10-40-11
+.. gh-issue: 129033
+.. nonce: d1jltB
+.. section: C API
+
+Remove ``_PyInterpreterState_GetConfigCopy()`` and
+``_PyInterpreterState_SetConfig()`` private functions. Use instead
+:c:func:`PyConfig_Get` and :c:func:`PyConfig_Set`, public C API added by
+:pep:`741` "Python Configuration C API". Patch by Victor Stinner.
+
+..
+
+.. date: 2025-01-19-23-17-58
+.. gh-issue: 129033
+.. nonce: cpRivP
+.. section: C API
+
+Remove the private ``_Py_InitializeMain()`` function. It was a
+:term:`provisional API` added to Python 3.8 by :pep:`587`. Patch by Victor
+Stinner.
+
+..
+
+.. date: 2025-01-16-21-56-49
+.. gh-issue: 128844
+.. nonce: ZPiJuo
+.. section: C API
+
+Add :c:func:`PyUnstable_TryIncRef` and :c:func:`PyUnstable_EnableTryIncRef`
+unstable APIs. These are helpers for dealing with unowned references in a
+thread-safe way, particularly in the free threading build.
+
+..
+
+.. date: 2025-01-16-12-47-01
+.. gh-issue: 128911
+.. nonce: mHVJ4x
+.. section: C API
+
+Add :c:func:`PyImport_ImportModuleAttr` and
+:c:func:`PyImport_ImportModuleAttrString` helper functions to import a
+module and get an attribute of the module. Patch by Victor Stinner.
+
+..
+
+.. date: 2025-01-15-11-42-07
+.. gh-issue: 128863
+.. nonce: C9MkB_
+.. section: C API
+
+The following private functions are deprecated and planned for removal in
+Python 3.18:
+
+* :c:func:`!_PyBytes_Join`: use :c:func:`PyBytes_Join`.
+* :c:func:`!_PyDict_GetItemStringWithError`: use :c:func:`PyDict_GetItemStringRef`.
+* :c:func:`!_PyDict_Pop()`: use :c:func:`PyDict_Pop`.
+* :c:func:`!_PyLong_Sign()`: use :c:func:`PyLong_GetSign`.
+* :c:func:`!_PyLong_FromDigits` and :c:func:`!_PyLong_New`:
+ use :c:func:`PyLongWriter_Create`.
+* :c:func:`!_PyThreadState_UncheckedGet`: use :c:func:`PyThreadState_GetUnchecked`.
+* :c:func:`!_PyUnicode_AsString`: use :c:func:`PyUnicode_AsUTF8`.
+* :c:func:`!_Py_HashPointer`: use :c:func:`Py_HashPointer`.
+* :c:func:`!_Py_fopen_obj`: use :c:func:`Py_fopen`.
+
+The `pythoncapi-compat project
+<https://github.com/python/pythoncapi-compat/>`__ can be used to get these
+new public functions on Python 3.13 and older.
+
+Patch by Victor Stinner.
+
+..
+
+.. date: 2025-01-01-03-25-38
+.. gh-issue: 126599
+.. nonce: MRCYlH
+.. section: C API
+
+Remove some internal test APIs for the experimental JIT compiler.
+
+..
+
+.. date: 2024-12-14-03-40-15
+.. gh-issue: 127925
+.. nonce: FF7aov
+.. section: C API
+
+Convert the :mod:`decimal` module to use :pep:`757` C API (export-import
+integers), offering some speed-up if the integer part of the
+:class:`~decimal.Decimal` instance is small. Patch by Sergey B Kirpichev.
+
+..
+
+.. date: 2025-02-04-12-30-43
+.. gh-issue: 129660
+.. nonce: SitXa7
+.. section: Build
+
+Drop ``test_embed`` from PGO training, whose contribution in recent versions
+is considered to be ignorable.
+
+..
+
+.. date: 2025-01-16-03-35-37
+.. gh-issue: 128902
+.. nonce: Dt7xtV
+.. section: Build
+
+Fix compile errors with Clang 9 and older due to lack of
+``__attribute__((fallthrough))`` support.