aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/pydoc_data/topics.py
diff options
context:
space:
mode:
authorHugo van Kemenade <1324225+hugovk@users.noreply.github.com>2024-10-15 22:29:35 +0300
committerHugo van Kemenade <1324225+hugovk@users.noreply.github.com>2024-10-15 22:34:54 +0300
commit8cdaca8b25e3354530d66cbccc622e0e914e8e8a (patch)
tree569f57edf7b734105549a331020eb14f73347240 /Lib/pydoc_data/topics.py
parent3ea488aac44887a7cdb30be69580c81a0ca6afe2 (diff)
downloadcpython-8cdaca8b25e3354530d66cbccc622e0e914e8e8a.tar.gz
cpython-8cdaca8b25e3354530d66cbccc622e0e914e8e8a.zip
Python 3.14.0a1v3.14.0a1
Diffstat (limited to 'Lib/pydoc_data/topics.py')
-rw-r--r--Lib/pydoc_data/topics.py1669
1 files changed, 1117 insertions, 552 deletions
diff --git a/Lib/pydoc_data/topics.py b/Lib/pydoc_data/topics.py
index ae56c136608..165d3853f95 100644
--- a/Lib/pydoc_data/topics.py
+++ b/Lib/pydoc_data/topics.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# Autogenerated by Sphinx on Wed May 8 11:11:17 2024
+# Autogenerated by Sphinx on Tue Oct 15 22:34:02 2024
# as part of the release process.
topics = {'assert': 'The "assert" statement\n'
'**********************\n'
@@ -308,10 +308,10 @@ topics = {'assert': 'The "assert" statement\n'
'target.\n'
'The target is only evaluated once.\n'
'\n'
- 'An augmented assignment expression like "x += 1" can be '
- 'rewritten as\n'
- '"x = x + 1" to achieve a similar, but not exactly equal '
- 'effect. In the\n'
+ 'An augmented assignment statement like "x += 1" can be '
+ 'rewritten as "x\n'
+ '= x + 1" to achieve a similar, but not exactly equal effect. '
+ 'In the\n'
'augmented version, "x" is only evaluated once. Also, when '
'possible,\n'
'the actual operation is performed *in-place*, meaning that '
@@ -362,21 +362,21 @@ topics = {'assert': 'The "assert" statement\n'
'a single\n'
'target is allowed.\n'
'\n'
- 'For simple names as assignment targets, if in class or module '
- 'scope,\n'
- 'the annotations are evaluated and stored in a special class or '
- 'module\n'
- 'attribute "__annotations__" that is a dictionary mapping from '
- 'variable\n'
- 'names (mangled if private) to evaluated annotations. This '
- 'attribute is\n'
- 'writable and is automatically created at the start of class or '
- 'module\n'
- 'body execution, if annotations are found statically.\n'
- '\n'
- 'For expressions as assignment targets, the annotations are '
+ 'The assignment target is considered “simple” if it consists of '
+ 'a\n'
+ 'single name that is not enclosed in parentheses. For simple '
+ 'assignment\n'
+ 'targets, if in class or module scope, the annotations are '
+ 'gathered in\n'
+ 'a lazily evaluated annotation scope. The annotations can be '
'evaluated\n'
- 'if in class or module scope, but not stored.\n'
+ 'using the "__annotations__" attribute of a class or module, or '
+ 'using\n'
+ 'the facilities in the "annotationlib" module.\n'
+ '\n'
+ 'If the assignment target is not simple (an attribute, '
+ 'subscript node,\n'
+ 'or parenthesized name), the annotation is never evaluated.\n'
'\n'
'If a name is annotated in a function scope, then this name is '
'local\n'
@@ -386,12 +386,13 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'If the right hand side is present, an annotated assignment '
'performs\n'
- 'the actual assignment before evaluating annotations (where\n'
- 'applicable). If the right hand side is not present for an '
- 'expression\n'
- 'target, then the interpreter evaluates the target except for '
- 'the last\n'
- '"__setitem__()" or "__setattr__()" call.\n'
+ 'the actual assignment as if there was no annotation present. '
+ 'If the\n'
+ 'right hand side is not present for an expression target, then '
+ 'the\n'
+ 'interpreter evaluates the target except for the last '
+ '"__setitem__()"\n'
+ 'or "__setattr__()" call.\n'
'\n'
'See also:\n'
'\n'
@@ -415,7 +416,13 @@ topics = {'assert': 'The "assert" statement\n'
'Previously,\n'
'some expressions (like un-parenthesized tuple expressions) '
'caused a\n'
- 'syntax error.\n',
+ 'syntax error.\n'
+ '\n'
+ 'Changed in version 3.14: Annotations are now lazily evaluated '
+ 'in a\n'
+ 'separate annotation scope. If the assignment target is not '
+ 'simple,\n'
+ 'annotations are never evaluated.\n',
'assignment-expressions': 'Assignment expressions\n'
'**********************\n'
'\n'
@@ -593,31 +600,67 @@ topics = {'assert': 'The "assert" statement\n'
'evaluate it\n'
'raises a "NameError" exception.\n'
'\n'
- '**Private name mangling:** When an identifier that '
- 'textually occurs in\n'
- 'a class definition begins with two or more underscore '
- 'characters and\n'
- 'does not end in two or more underscores, it is '
- 'considered a *private\n'
- 'name* of that class. Private names are transformed to a '
- 'longer form\n'
- 'before code is generated for them. The transformation '
- 'inserts the\n'
- 'class name, with leading underscores removed and a '
- 'single underscore\n'
- 'inserted, in front of the name. For example, the '
- 'identifier "__spam"\n'
- 'occurring in a class named "Ham" will be transformed to '
- '"_Ham__spam".\n'
- 'This transformation is independent of the syntactical '
+ '\n'
+ 'Private name mangling\n'
+ '=====================\n'
+ '\n'
+ 'When an identifier that textually occurs in a class '
+ 'definition begins\n'
+ 'with two or more underscore characters and does not end '
+ 'in two or more\n'
+ 'underscores, it is considered a *private name* of that '
+ 'class.\n'
+ '\n'
+ 'See also: The class specifications.\n'
+ '\n'
+ 'More precisely, private names are transformed to a '
+ 'longer form before\n'
+ 'code is generated for them. If the transformed name is '
+ 'longer than\n'
+ '255 characters, implementation-defined truncation may '
+ 'happen.\n'
+ '\n'
+ 'The transformation is independent of the syntactical '
'context in which\n'
- 'the identifier is used. If the transformed name is '
- 'extremely long\n'
- '(longer than 255 characters), implementation defined '
- 'truncation may\n'
- 'happen. If the class name consists only of underscores, '
- 'no\n'
- 'transformation is done.\n',
+ 'the identifier is used but only the following private '
+ 'identifiers are\n'
+ 'mangled:\n'
+ '\n'
+ '* Any name used as the name of a variable that is '
+ 'assigned or read or\n'
+ ' any name of an attribute being accessed.\n'
+ '\n'
+ ' The "__name__" attribute of nested functions, classes, '
+ 'and type\n'
+ ' aliases is however not mangled.\n'
+ '\n'
+ '* The name of imported modules, e.g., "__spam" in '
+ '"import __spam". If\n'
+ ' the module is part of a package (i.e., its name '
+ 'contains a dot), the\n'
+ ' name is *not* mangled, e.g., the "__foo" in "import '
+ '__foo.bar" is\n'
+ ' not mangled.\n'
+ '\n'
+ '* The name of an imported member, e.g., "__f" in "from '
+ 'spam import\n'
+ ' __f".\n'
+ '\n'
+ 'The transformation rule is defined as follows:\n'
+ '\n'
+ '* The class name, with leading underscores removed and a '
+ 'single\n'
+ ' leading underscore inserted, is inserted in front of '
+ 'the identifier,\n'
+ ' e.g., the identifier "__spam" occurring in a class '
+ 'named "Foo",\n'
+ ' "_Foo" or "__Foo" is transformed to "_Foo__spam".\n'
+ '\n'
+ '* If the class name consists only of underscores, the '
+ 'transformation\n'
+ ' is the identity, e.g., the identifier "__spam" '
+ 'occurring in a class\n'
+ ' named "_" or "__" is left as is.\n',
'atom-literals': 'Literals\n'
'********\n'
'\n'
@@ -630,10 +673,10 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'Evaluation of a literal yields an object of the given type '
'(string,\n'
- 'bytes, integer, floating point number, complex number) with '
+ 'bytes, integer, floating-point number, complex number) with '
'the given\n'
'value. The value may be approximated in the case of '
- 'floating point\n'
+ 'floating-point\n'
'and imaginary (complex) literals. See section Literals for '
'details.\n'
'\n'
@@ -1091,11 +1134,13 @@ topics = {'assert': 'The "assert" statement\n'
'to the class\n'
' where it is defined. *__slots__* declared in parents '
'are available\n'
- ' in child classes. However, child subclasses will get a '
- '"__dict__"\n'
- ' and *__weakref__* unless they also define *__slots__* '
- '(which should\n'
- ' only contain names of any *additional* slots).\n'
+ ' in child classes. However, instances of a child '
+ 'subclass will get a\n'
+ ' "__dict__" and *__weakref__* unless the subclass also '
+ 'defines\n'
+ ' *__slots__* (which should only contain names of any '
+ '*additional*\n'
+ ' slots).\n'
'\n'
'* If a class defines a slot also defined in a base '
'class, the instance\n'
@@ -1201,10 +1246,10 @@ topics = {'assert': 'The "assert" statement\n'
'target.\n'
'The target is only evaluated once.\n'
'\n'
- 'An augmented assignment expression like "x += 1" can be '
- 'rewritten as\n'
- '"x = x + 1" to achieve a similar, but not exactly equal effect. '
- 'In the\n'
+ 'An augmented assignment statement like "x += 1" can be '
+ 'rewritten as "x\n'
+ '= x + 1" to achieve a similar, but not exactly equal effect. In '
+ 'the\n'
'augmented version, "x" is only evaluated once. Also, when '
'possible,\n'
'the actual operation is performed *in-place*, meaning that '
@@ -1277,6 +1322,10 @@ topics = {'assert': 'The "assert" statement\n'
'The "@" (at) operator is intended to be used for matrix\n'
'multiplication. No builtin Python types implement this operator.\n'
'\n'
+ 'This operation can be customized using the special "__matmul__()" '
+ 'and\n'
+ '"__rmatmul__()" methods.\n'
+ '\n'
'Added in version 3.5.\n'
'\n'
'The "/" (division) and "//" (floor division) operators yield the\n'
@@ -1289,17 +1338,19 @@ topics = {'assert': 'The "assert" statement\n'
'result. Division by zero raises the "ZeroDivisionError" '
'exception.\n'
'\n'
- 'This operation can be customized using the special "__truediv__()" '
+ 'The division operation can be customized using the special\n'
+ '"__truediv__()" and "__rtruediv__()" methods. The floor division\n'
+ 'operation can be customized using the special "__floordiv__()" '
'and\n'
- '"__floordiv__()" methods.\n'
+ '"__rfloordiv__()" methods.\n'
'\n'
'The "%" (modulo) operator yields the remainder from the division '
'of\n'
'the first argument by the second. The numeric arguments are '
'first\n'
'converted to a common type. A zero right argument raises the\n'
- '"ZeroDivisionError" exception. The arguments may be floating '
- 'point\n'
+ '"ZeroDivisionError" exception. The arguments may be '
+ 'floating-point\n'
'numbers, e.g., "3.14%0.7" equals "0.34" (since "3.14" equals '
'"4*0.7 +\n'
'0.34".) The modulo operator always yields a result with the same '
@@ -1326,13 +1377,13 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'The *modulo* operation can be customized using the special '
'"__mod__()"\n'
- 'method.\n'
+ 'and "__rmod__()" methods.\n'
'\n'
'The floor division operator, the modulo operator, and the '
'"divmod()"\n'
'function are not defined for complex numbers. Instead, convert to '
'a\n'
- 'floating point number using the "abs()" function if appropriate.\n'
+ 'floating-point number using the "abs()" function if appropriate.\n'
'\n'
'The "+" (addition) operator yields the sum of its arguments. The\n'
'arguments must either both be numbers or both be sequences of the '
@@ -1351,7 +1402,8 @@ topics = {'assert': 'The "assert" statement\n'
'The numeric arguments are first converted to a common type.\n'
'\n'
'This operation can be customized using the special "__sub__()" '
- 'method.\n',
+ 'and\n'
+ '"__rsub__()" methods.\n',
'bitwise': 'Binary bitwise operations\n'
'*************************\n'
'\n'
@@ -2426,18 +2478,16 @@ topics = {'assert': 'The "assert" statement\n'
'An\n'
'expression-less "except" clause, if present, must be last; it '
'matches\n'
- 'any exception. For an "except" clause with an expression, that\n'
- 'expression is evaluated, and the clause matches the exception if '
- 'the\n'
- 'resulting object is “compatible” with the exception. An object '
- 'is\n'
- 'compatible with an exception if the object is the class or a '
- '*non-\n'
- 'virtual base class* of the exception object, or a tuple '
- 'containing an\n'
- 'item that is the class or a non-virtual base class of the '
- 'exception\n'
- 'object.\n'
+ 'any exception.\n'
+ '\n'
+ 'For an "except" clause with an expression, the expression must\n'
+ 'evaluate to an exception type or a tuple of exception types. '
+ 'The\n'
+ 'raised exception matches an "except" clause whose expression '
+ 'evaluates\n'
+ 'to the class or a *non-virtual base class* of the exception '
+ 'object, or\n'
+ 'to a tuple that contains such a class.\n'
'\n'
'If no "except" clause matches the exception, the search for an\n'
'exception handler continues in the surrounding code and on the\n'
@@ -2586,13 +2636,16 @@ topics = {'assert': 'The "assert" statement\n'
' ...\n'
" ExceptionGroup('', (BlockingIOError()))\n"
'\n'
- 'An "except*" clause must have a matching type, and this type '
- 'cannot be\n'
- 'a subclass of "BaseExceptionGroup". It is not possible to mix '
- '"except"\n'
- 'and "except*" in the same "try". "break", "continue" and '
- '"return"\n'
- 'cannot appear in an "except*" clause.\n'
+ 'An "except*" clause must have a matching expression; it cannot '
+ 'be\n'
+ '"except*:". Furthermore, this expression cannot contain '
+ 'exception\n'
+ 'group types, because that would have ambiguous semantics.\n'
+ '\n'
+ 'It is not possible to mix "except" and "except*" in the same '
+ '"try".\n'
+ '"break", "continue" and "return" cannot appear in an "except*" '
+ 'clause.\n'
'\n'
'\n'
'"else" clause\n'
@@ -3090,7 +3143,7 @@ topics = {'assert': 'The "assert" statement\n'
' | "None"\n'
' | "True"\n'
' | "False"\n'
- ' | signed_number: NUMBER | "-" NUMBER\n'
+ ' signed_number ::= ["-"] NUMBER\n'
'\n'
'The rule "strings" and the token "NUMBER" are defined in the '
'standard\n'
@@ -3560,10 +3613,12 @@ topics = {'assert': 'The "assert" statement\n'
' parameter_list_no_posonly ::= defparameter ("," '
'defparameter)* ["," [parameter_list_starargs]]\n'
' | parameter_list_starargs\n'
- ' parameter_list_starargs ::= "*" [parameter] ("," '
+ ' parameter_list_starargs ::= "*" [star_parameter] ("," '
'defparameter)* ["," ["**" parameter [","]]]\n'
' | "**" parameter [","]\n'
' parameter ::= identifier [":" expression]\n'
+ ' star_parameter ::= identifier [":" ["*"] '
+ 'expression]\n'
' defparameter ::= parameter ["=" expression]\n'
' funcname ::= identifier\n'
'\n'
@@ -3691,27 +3746,22 @@ topics = {'assert': 'The "assert" statement\n'
'expression"”\n'
'following the parameter name. Any parameter may have an '
'annotation,\n'
- 'even those of the form "*identifier" or "**identifier". '
- 'Functions may\n'
- 'have “return” annotation of the form “"-> expression"” after '
- 'the\n'
- 'parameter list. These annotations can be any valid Python '
- 'expression.\n'
- 'The presence of annotations does not change the semantics of a\n'
- 'function. The annotation values are available as values of a\n'
- 'dictionary keyed by the parameters’ names in the '
- '"__annotations__"\n'
- 'attribute of the function object. If the "annotations" import '
- 'from\n'
- '"__future__" is used, annotations are preserved as strings at '
- 'runtime\n'
- 'which enables postponed evaluation. Otherwise, they are '
- 'evaluated\n'
- 'when the function definition is executed. In this case '
- 'annotations\n'
- 'may be evaluated in a different order than they appear in the '
- 'source\n'
- 'code.\n'
+ 'even those of the form "*identifier" or "**identifier". (As a '
+ 'special\n'
+ 'case, parameters of the form "*identifier" may have an '
+ 'annotation “":\n'
+ '*expression"”.) Functions may have “return” annotation of the '
+ 'form\n'
+ '“"-> expression"” after the parameter list. These annotations '
+ 'can be\n'
+ 'any valid Python expression. The presence of annotations does '
+ 'not\n'
+ 'change the semantics of a function. See Annotations for more\n'
+ 'information on annotations.\n'
+ '\n'
+ 'Changed in version 3.11: Parameters of the form “"*identifier"” '
+ 'may\n'
+ 'have an annotation “": *expression"”. See **PEP 646**.\n'
'\n'
'It is also possible to create anonymous functions (functions not '
'bound\n'
@@ -4301,6 +4351,56 @@ topics = {'assert': 'The "assert" statement\n'
'not\n'
'actually bound at runtime.\n'
'\n'
+ '\n'
+ 'Annotations\n'
+ '===========\n'
+ '\n'
+ 'Changed in version 3.14: Annotations are now lazily evaluated '
+ 'by\n'
+ 'default.\n'
+ '\n'
+ 'Variables and function parameters may carry *annotations*, '
+ 'created by\n'
+ 'adding a colon after the name, followed by an expression:\n'
+ '\n'
+ ' x: annotation = 1\n'
+ ' def f(param: annotation): ...\n'
+ '\n'
+ 'Functions may also carry a return annotation following an '
+ 'arrow:\n'
+ '\n'
+ ' def f() -> annotation: ...\n'
+ '\n'
+ 'Annotations are conventionally used for *type hints*, but this '
+ 'is not\n'
+ 'enforced by the language, and in general annotations may '
+ 'contain\n'
+ 'arbitrary expressions. The presence of annotations does not '
+ 'change the\n'
+ 'runtime semantics of the code, except if some mechanism is used '
+ 'that\n'
+ 'introspects and uses the annotations (such as "dataclasses" or\n'
+ '"functools.singledispatch()").\n'
+ '\n'
+ 'By default, annotations are lazily evaluated in a annotation '
+ 'scope.\n'
+ 'This means that they are not evaluated when the code containing '
+ 'the\n'
+ 'annotation is evaluated. Instead, the interpreter saves '
+ 'information\n'
+ 'that can be used to evaluate the annotation later if requested. '
+ 'The\n'
+ '"annotationlib" module provides tools for evaluating '
+ 'annotations.\n'
+ '\n'
+ 'If the future statement "from __future__ import annotations" is\n'
+ 'present, all annotations are instead stored as strings:\n'
+ '\n'
+ ' >>> from __future__ import annotations\n'
+ ' >>> def f(param: annotation): ...\n'
+ ' >>> f.__annotations__\n'
+ " {'param': 'annotation'}\n"
+ '\n'
'-[ Footnotes ]-\n'
'\n'
'[1] The exception is propagated to the invocation stack unless '
@@ -4463,7 +4563,7 @@ topics = {'assert': 'The "assert" statement\n'
'converted to\n'
' complex;\n'
'\n'
- '* otherwise, if either argument is a floating point number, '
+ '* otherwise, if either argument is a floating-point number, '
'the other\n'
' is converted to floating point;\n'
'\n'
@@ -4574,6 +4674,10 @@ topics = {'assert': 'The "assert" statement\n'
' It is not guaranteed that "__del__()" methods are called '
'for\n'
' objects that still exist when the interpreter exits.\n'
+ ' "weakref.finalize" provides a straightforward way to '
+ 'register a\n'
+ ' cleanup function to be called when an object is garbage '
+ 'collected.\n'
'\n'
' Note:\n'
'\n'
@@ -5072,6 +5176,12 @@ topics = {'assert': 'The "assert" statement\n'
' 0\n'
' (Pdb)\n'
'\n'
+ 'Changed in version 3.13: The implementation of **PEP 667** means '
+ 'that\n'
+ 'name assignments made via "pdb" will immediately affect the '
+ 'active\n'
+ 'scope, even when running inside an *optimized scope*.\n'
+ '\n'
'The module defines the following functions; each enters the '
'debugger\n'
'in a slightly different way:\n'
@@ -5113,7 +5223,7 @@ topics = {'assert': 'The "assert" statement\n'
'appears\n'
' as soon as the function is entered.\n'
'\n'
- 'pdb.set_trace(*, header=None)\n'
+ 'pdb.set_trace(*, header=None, commands=None)\n'
'\n'
' Enter the debugger at the calling stack frame. This is '
'useful to\n'
@@ -5122,7 +5232,9 @@ topics = {'assert': 'The "assert" statement\n'
' code is not otherwise being debugged (e.g. when an assertion\n'
' fails). If given, *header* is printed to the console just '
'before\n'
- ' debugging begins.\n'
+ ' debugging begins. The *commands* argument, if given, is a '
+ 'list of\n'
+ ' commands to execute when the debugger starts.\n'
'\n'
' Changed in version 3.7: The keyword-only argument *header*.\n'
'\n'
@@ -5131,6 +5243,8 @@ topics = {'assert': 'The "assert" statement\n'
' immediately, rather than on the next line of code to be '
'executed.\n'
'\n'
+ ' Added in version 3.14: The *commands* argument.\n'
+ '\n'
'pdb.post_mortem(traceback=None)\n'
'\n'
' Enter post-mortem debugging of the given *traceback* object. '
@@ -5153,7 +5267,7 @@ topics = {'assert': 'The "assert" statement\n'
'to access further features, you have to do this yourself:\n'
'\n'
"class pdb.Pdb(completekey='tab', stdin=None, stdout=None, "
- 'skip=None, nosigint=False, readrc=True)\n'
+ 'skip=None, nosigint=False, readrc=True, mode=None)\n'
'\n'
' "Pdb" is the debugger class.\n'
'\n'
@@ -5182,6 +5296,15 @@ topics = {'assert': 'The "assert" statement\n'
'Pdb\n'
' will load .pdbrc files from the filesystem.\n'
'\n'
+ ' The *mode* argument specifies how the debugger was invoked. '
+ 'It\n'
+ ' impacts the workings of some debugger commands. Valid values '
+ 'are\n'
+ ' "\'inline\'" (used by the breakpoint() builtin), "\'cli\'" '
+ '(used by the\n'
+ ' command line invocation) or "None" (for backwards compatible\n'
+ ' behaviour, as before the *mode* argument was added).\n'
+ '\n'
' Example call to enable tracing with *skip*:\n'
'\n'
" import pdb; pdb.Pdb(skip=['django.*']).set_trace()\n"
@@ -5196,6 +5319,8 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
' Changed in version 3.6: The *readrc* argument.\n'
'\n'
+ ' Added in version 3.14: Added the *mode* argument.\n'
+ '\n'
' run(statement, globals=None, locals=None)\n'
' runeval(expression, globals=None, locals=None)\n'
' runcall(function, *args, **kwds)\n'
@@ -5283,7 +5408,8 @@ topics = {'assert': 'The "assert" statement\n'
'* "$_exception": the exception if the frame is raising an '
'exception\n'
'\n'
- 'Added in version 3.12.\n'
+ 'Added in version 3.12: Added the *convenience variable* '
+ 'feature.\n'
'\n'
'If a file ".pdbrc" exists in the user’s home directory or in '
'the\n'
@@ -5317,13 +5443,20 @@ topics = {'assert': 'The "assert" statement\n'
'"help\n'
' exec" must be entered to get help on the "!" command.\n'
'\n'
- 'w(here)\n'
+ 'w(here) [count]\n'
'\n'
' Print a stack trace, with the most recent frame at the '
- 'bottom. An\n'
- ' arrow (">") indicates the current frame, which determines '
- 'the\n'
- ' context of most commands.\n'
+ 'bottom. if\n'
+ ' *count* is 0, print the current frame entry. If *count* is\n'
+ ' negative, print the least recent - *count* frames. If *count* '
+ 'is\n'
+ ' positive, print the most recent *count* frames. An arrow '
+ '(">")\n'
+ ' indicates the current frame, which determines the context of '
+ 'most\n'
+ ' commands.\n'
+ '\n'
+ ' Changed in version 3.14: *count* argument is added.\n'
'\n'
'd(own) [count]\n'
'\n'
@@ -5347,7 +5480,7 @@ topics = {'assert': 'The "assert" statement\n'
'one that\n'
' hasn’t been loaded yet). The file is searched on '
'"sys.path".\n'
- ' Accepatable forms of *filename* are "/abspath/to/file.py",\n'
+ ' Acceptable forms of *filename* are "/abspath/to/file.py",\n'
' "relpath/file.py", "module" and "package.module".\n'
'\n'
' With a *function* argument, set a break at the first '
@@ -5449,25 +5582,27 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
' Specifying any command resuming execution (currently '
'"continue",\n'
- ' "step", "next", "return", "jump", "quit" and their '
- 'abbreviations)\n'
- ' terminates the command list (as if that command was '
- 'immediately\n'
- ' followed by end). This is because any time you resume '
- 'execution\n'
- ' (even with a simple next or step), you may encounter another\n'
- ' breakpoint—which could have its own command list, leading to\n'
- ' ambiguities about which list to execute.\n'
- '\n'
- ' If you use the "silent" command in the command list, the '
- 'usual\n'
- ' message about stopping at a breakpoint is not printed. This '
- 'may be\n'
- ' desirable for breakpoints that are to print a specific '
- 'message and\n'
- ' then continue. If none of the other commands print anything, '
- 'you\n'
- ' see no sign that the breakpoint was reached.\n'
+ ' "step", "next", "return", "until", "jump", "quit" and their\n'
+ ' abbreviations) terminates the command list (as if that '
+ 'command was\n'
+ ' immediately followed by end). This is because any time you '
+ 'resume\n'
+ ' execution (even with a simple next or step), you may '
+ 'encounter\n'
+ ' another breakpoint—which could have its own command list, '
+ 'leading\n'
+ ' to ambiguities about which list to execute.\n'
+ '\n'
+ ' If the list of commands contains the "silent" command, or a '
+ 'command\n'
+ ' that resumes execution, then the breakpoint message '
+ 'containing\n'
+ ' information about the frame is not displayed.\n'
+ '\n'
+ ' Changed in version 3.14: Frame information will not be '
+ 'displayed if\n'
+ ' a command that resumes execution is present in the command '
+ 'list.\n'
'\n'
's(tep)\n'
'\n'
@@ -5658,24 +5793,22 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'interact\n'
'\n'
- ' Start an interactive interpreter (using the "code" module) '
- 'whose\n'
- ' global namespace contains all the (global and local) names '
- 'found in\n'
- ' the current scope. Use "exit()" or "quit()" to exit the '
- 'interpreter\n'
- ' and return to the debugger.\n'
+ ' Start an interactive interpreter (using the "code" module) in '
+ 'a new\n'
+ ' global namespace initialised from the local and global '
+ 'namespaces\n'
+ ' for the current scope. Use "exit()" or "quit()" to exit the\n'
+ ' interpreter and return to the debugger.\n'
'\n'
' Note:\n'
'\n'
- ' Because interact creates a new global namespace with the '
- 'current\n'
- ' global and local namespace for execution, assignment to '
- 'variables\n'
- ' will not affect the original namespaces. However, '
- 'modification to\n'
- ' the mutable objects will be reflected in the original '
- 'namespaces.\n'
+ ' As "interact" creates a new dedicated namespace for code\n'
+ ' execution, assignments to variables will not affect the '
+ 'original\n'
+ ' namespaces. However, modifications to any referenced '
+ 'mutable\n'
+ ' objects will be reflected in the original namespaces as '
+ 'usual.\n'
'\n'
' Added in version 3.2.\n'
'\n'
@@ -5755,6 +5888,10 @@ topics = {'assert': 'The "assert" statement\n'
'preserved.\n'
' "restart" is an alias for "run".\n'
'\n'
+ ' Changed in version 3.14: "run" and "restart" commands are '
+ 'disabled\n'
+ ' when the debugger is invoked in "\'inline\'" mode.\n'
+ '\n'
'q(uit)\n'
'\n'
' Quit from the debugger. The program being executed is '
@@ -6264,17 +6401,18 @@ topics = {'assert': 'The "assert" statement\n'
'Annotation scopes\n'
'-----------------\n'
'\n'
- 'Type parameter lists and "type" statements introduce '
- '*annotation\n'
- 'scopes*, which behave mostly like function scopes, but with '
- 'some\n'
- 'exceptions discussed below. *Annotations* currently do not use\n'
- 'annotation scopes, but they are expected to use annotation '
- 'scopes in\n'
- 'Python 3.13 when **PEP 649** is implemented.\n'
+ '*Annotations*, type parameter lists and "type" statements '
+ 'introduce\n'
+ '*annotation scopes*, which behave mostly like function scopes, '
+ 'but\n'
+ 'with some exceptions discussed below.\n'
'\n'
'Annotation scopes are used in the following contexts:\n'
'\n'
+ '* *Function annotations*.\n'
+ '\n'
+ '* *Variable annotations*.\n'
+ '\n'
'* Type parameter lists for generic type aliases.\n'
'\n'
'* Type parameter lists for generic functions. A generic '
@@ -6328,11 +6466,11 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'* While annotation scopes have an internal name, that name is '
'not\n'
- ' reflected in the *__qualname__* of objects defined within the '
- 'scope.\n'
- ' Instead, the "__qualname__" of such objects is as if the '
- 'object were\n'
- ' defined in the enclosing scope.\n'
+ ' reflected in the *qualified name* of objects defined within '
+ 'the\n'
+ ' scope. Instead, the "__qualname__" of such objects is as if '
+ 'the\n'
+ ' object were defined in the enclosing scope.\n'
'\n'
'Added in version 3.12: Annotation scopes were introduced in '
'Python\n'
@@ -6342,21 +6480,26 @@ topics = {'assert': 'The "assert" statement\n'
'type\n'
'parameter defaults, as introduced by **PEP 696**.\n'
'\n'
+ 'Changed in version 3.14: Annotation scopes are now also used '
+ 'for\n'
+ 'annotations, as specified in **PEP 649** and **PEP 749**.\n'
+ '\n'
'\n'
'Lazy evaluation\n'
'---------------\n'
'\n'
- 'The values of type aliases created through the "type" statement '
- 'are\n'
- '*lazily evaluated*. The same applies to the bounds, '
- 'constraints, and\n'
- 'default values of type variables created through the type '
- 'parameter\n'
- 'syntax. This means that they are not evaluated when the type '
- 'alias or\n'
- 'type variable is created. Instead, they are only evaluated when '
- 'doing\n'
- 'so is necessary to resolve an attribute access.\n'
+ 'Most annotation scopes are *lazily evaluated*. This includes\n'
+ 'annotations, the values of type aliases created through the '
+ '"type"\n'
+ 'statement, and the bounds, constraints, and default values of '
+ 'type\n'
+ 'variables created through the type parameter syntax. This means '
+ 'that\n'
+ 'they are not evaluated when the type alias or type variable is\n'
+ 'created, or when the object carrying annotations is created. '
+ 'Instead,\n'
+ 'they are only evaluated when necessary, for example when the\n'
+ '"__value__" attribute on a type alias is accessed.\n'
'\n'
'Example:\n'
'\n'
@@ -6534,12 +6677,17 @@ topics = {'assert': 'The "assert" statement\n'
'exprlists': 'Expression lists\n'
'****************\n'
'\n'
- ' expression_list ::= expression ("," expression)* [","]\n'
- ' starred_list ::= starred_item ("," starred_item)* '
+ ' starred_expression ::= ["*"] or_expr\n'
+ ' flexible_expression ::= assignment_expression | '
+ 'starred_expression\n'
+ ' flexible_expression_list ::= flexible_expression ("," '
+ 'flexible_expression)* [","]\n'
+ ' starred_expression_list ::= starred_expression ("," '
+ 'starred_expression)* [","]\n'
+ ' expression_list ::= expression ("," expression)* '
'[","]\n'
- ' starred_expression ::= expression | (starred_item ",")* '
- '[starred_item]\n'
- ' starred_item ::= assignment_expression | "*" or_expr\n'
+ ' yield_list ::= expression_list | '
+ 'starred_expression "," [starred_expression_list]\n'
'\n'
'Except when part of a list or set display, an expression list\n'
'containing at least one comma yields a tuple. The length of '
@@ -6558,6 +6706,10 @@ topics = {'assert': 'The "assert" statement\n'
'Added in version 3.5: Iterable unpacking in expression lists,\n'
'originally proposed by **PEP 448**.\n'
'\n'
+ 'Added in version 3.11: Any item in an expression list may be '
+ 'starred.\n'
+ 'See **PEP 646**.\n'
+ '\n'
'A trailing comma is required only to create a one-item tuple, '
'such as\n'
'"1,"; it is optional in all other cases. A single expression '
@@ -6567,10 +6719,10 @@ topics = {'assert': 'The "assert" statement\n'
'that expression. (To create an empty tuple, use an empty pair '
'of\n'
'parentheses: "()".)\n',
- 'floating': 'Floating point literals\n'
+ 'floating': 'Floating-point literals\n'
'***********************\n'
'\n'
- 'Floating point literals are described by the following lexical\n'
+ 'Floating-point literals are described by the following lexical\n'
'definitions:\n'
'\n'
' floatnumber ::= pointfloat | exponentfloat\n'
@@ -6584,12 +6736,12 @@ topics = {'assert': 'The "assert" statement\n'
'using\n'
'radix 10. For example, "077e010" is legal, and denotes the same '
'number\n'
- 'as "77e10". The allowed range of floating point literals is\n'
+ 'as "77e10". The allowed range of floating-point literals is\n'
'implementation-dependent. As in integer literals, underscores '
'are\n'
'supported for digit grouping.\n'
'\n'
- 'Some examples of floating point literals:\n'
+ 'Some examples of floating-point literals:\n'
'\n'
' 3.14 10. .001 1e100 3.14e-10 0e0 '
'3.14_15_93\n'
@@ -6972,7 +7124,7 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'The "\'_\'" option signals the use of an underscore for a '
'thousands\n'
- 'separator for floating point presentation types and for '
+ 'separator for floating-point presentation types and for '
'integer\n'
'presentation type "\'d\'". For integer presentation types '
'"\'b\'", "\'o\'",\n'
@@ -7099,11 +7251,11 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'In addition to the above presentation types, integers can '
'be formatted\n'
- 'with the floating point presentation types listed below '
+ 'with the floating-point presentation types listed below '
'(except "\'n\'"\n'
'and "None"). When doing so, "float()" is used to convert '
'the integer\n'
- 'to a floating point number before formatting.\n'
+ 'to a floating-point number before formatting.\n'
'\n'
'The available presentation types for "float" and "Decimal" '
'values are:\n'
@@ -7129,12 +7281,10 @@ topics = {'assert': 'The "assert" statement\n'
'of "6" digits |\n'
' | | after the decimal point for "float", and '
'shows all |\n'
- ' | | coefficient digits for "Decimal". If no '
- 'digits follow the |\n'
- ' | | decimal point, the decimal point is also '
- 'removed unless |\n'
- ' | | the "#" option is '
- 'used. |\n'
+ ' | | coefficient digits for "Decimal". If '
+ '"p=0", the decimal |\n'
+ ' | | point is omitted unless the "#" option is '
+ 'used. |\n'
' '
'+-----------+------------------------------------------------------------+\n'
' | "\'E\'" | Scientific notation. Same as "\'e\'" '
@@ -7153,12 +7303,10 @@ topics = {'assert': 'The "assert" statement\n'
'decimal point for |\n'
' | | "float", and uses a precision large enough '
'to show all |\n'
- ' | | coefficient digits for "Decimal". If no '
- 'digits follow the |\n'
- ' | | decimal point, the decimal point is also '
- 'removed unless |\n'
- ' | | the "#" option is '
- 'used. |\n'
+ ' | | coefficient digits for "Decimal". If '
+ '"p=0", the decimal |\n'
+ ' | | point is omitted unless the "#" option is '
+ 'used. |\n'
' '
'+-----------+------------------------------------------------------------+\n'
' | "\'F\'" | Fixed-point notation. Same as "\'f\'", '
@@ -7243,18 +7391,22 @@ topics = {'assert': 'The "assert" statement\n'
'percent sign. |\n'
' '
'+-----------+------------------------------------------------------------+\n'
- ' | None | For "float" this is the same as "\'g\'", '
- 'except that when |\n'
- ' | | fixed-point notation is used to format the '
- 'result, it |\n'
+ ' | None | For "float" this is like the "\'g\'" type, '
+ 'except that when |\n'
+ ' | | fixed- point notation is used to format '
+ 'the result, it |\n'
' | | always includes at least one digit past '
- 'the decimal point. |\n'
- ' | | The precision used is as large as needed '
- 'to represent the |\n'
- ' | | given value faithfully. For "Decimal", '
- 'this is the same |\n'
- ' | | as either "\'g\'" or "\'G\'" depending on '
- 'the value of |\n'
+ 'the decimal point, |\n'
+ ' | | and switches to the scientific notation '
+ 'when "exp >= p - |\n'
+ ' | | 1". When the precision is not specified, '
+ 'the latter will |\n'
+ ' | | be as large as needed to represent the '
+ 'given value |\n'
+ ' | | faithfully. For "Decimal", this is the '
+ 'same as either |\n'
+ ' | | "\'g\'" or "\'G\'" depending on the value '
+ 'of |\n'
' | | "context.capitals" for the current decimal '
'context. The |\n'
' | | overall effect is to match the output of '
@@ -7444,10 +7596,12 @@ topics = {'assert': 'The "assert" statement\n'
' parameter_list_no_posonly ::= defparameter ("," '
'defparameter)* ["," [parameter_list_starargs]]\n'
' | parameter_list_starargs\n'
- ' parameter_list_starargs ::= "*" [parameter] ("," '
+ ' parameter_list_starargs ::= "*" [star_parameter] ("," '
'defparameter)* ["," ["**" parameter [","]]]\n'
' | "**" parameter [","]\n'
' parameter ::= identifier [":" expression]\n'
+ ' star_parameter ::= identifier [":" ["*"] '
+ 'expression]\n'
' defparameter ::= parameter ["=" expression]\n'
' funcname ::= identifier\n'
'\n'
@@ -7575,27 +7729,22 @@ topics = {'assert': 'The "assert" statement\n'
'expression"”\n'
'following the parameter name. Any parameter may have an '
'annotation,\n'
- 'even those of the form "*identifier" or "**identifier". '
- 'Functions may\n'
- 'have “return” annotation of the form “"-> expression"” after '
- 'the\n'
- 'parameter list. These annotations can be any valid Python '
- 'expression.\n'
- 'The presence of annotations does not change the semantics of a\n'
- 'function. The annotation values are available as values of a\n'
- 'dictionary keyed by the parameters’ names in the '
- '"__annotations__"\n'
- 'attribute of the function object. If the "annotations" import '
- 'from\n'
- '"__future__" is used, annotations are preserved as strings at '
- 'runtime\n'
- 'which enables postponed evaluation. Otherwise, they are '
- 'evaluated\n'
- 'when the function definition is executed. In this case '
- 'annotations\n'
- 'may be evaluated in a different order than they appear in the '
- 'source\n'
- 'code.\n'
+ 'even those of the form "*identifier" or "**identifier". (As a '
+ 'special\n'
+ 'case, parameters of the form "*identifier" may have an '
+ 'annotation “":\n'
+ '*expression"”.) Functions may have “return” annotation of the '
+ 'form\n'
+ '“"-> expression"” after the parameter list. These annotations '
+ 'can be\n'
+ 'any valid Python expression. The presence of annotations does '
+ 'not\n'
+ 'change the semantics of a function. See Annotations for more\n'
+ 'information on annotations.\n'
+ '\n'
+ 'Changed in version 3.11: Parameters of the form “"*identifier"” '
+ 'may\n'
+ 'have an annotation “": *expression"”. See **PEP 646**.\n'
'\n'
'It is also possible to create anonymous functions (functions not '
'bound\n'
@@ -7669,7 +7818,7 @@ topics = {'assert': 'The "assert" statement\n'
'parameters, or as targets in "with" statements or "except" '
'clauses, or\n'
'in a "for" target list, "class" definition, function definition,\n'
- '"import" statement, or variable annotation.\n'
+ '"import" statement, or *variable annotations*.\n'
'\n'
'**CPython implementation detail:** The current implementation does '
'not\n'
@@ -7764,19 +7913,16 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'Within the ASCII range (U+0001..U+007F), the valid characters '
'for\n'
- 'identifiers are the same as in Python 2.x: the uppercase and '
- 'lowercase\n'
- 'letters "A" through "Z", the underscore "_" and, except for '
- 'the first\n'
- 'character, the digits "0" through "9".\n'
- '\n'
- 'Python 3.0 introduces additional characters from outside the '
- 'ASCII\n'
- 'range (see **PEP 3131**). For these characters, the '
- 'classification\n'
- 'uses the version of the Unicode Character Database as '
- 'included in the\n'
- '"unicodedata" module.\n'
+ 'identifiers include the uppercase and lowercase letters "A" '
+ 'through\n'
+ '"Z", the underscore "_" and, except for the first character, '
+ 'the\n'
+ 'digits "0" through "9". Python 3.0 introduced additional '
+ 'characters\n'
+ 'from outside the ASCII range (see **PEP 3131**). For these\n'
+ 'characters, the classification uses the version of the '
+ 'Unicode\n'
+ 'Character Database as included in the "unicodedata" module.\n'
'\n'
'Identifiers are unlimited in length. Case is significant.\n'
'\n'
@@ -7826,8 +7972,8 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'A non-normative HTML file listing all valid identifier '
'characters for\n'
- 'Unicode 15.1.0 can be found at\n'
- 'https://www.unicode.org/Public/15.1.0/ucd/DerivedCoreProperties.txt\n'
+ 'Unicode 16.0.0 can be found at\n'
+ 'https://www.unicode.org/Public/16.0.0/ucd/DerivedCoreProperties.txt\n'
'\n'
'\n'
'Keywords\n'
@@ -7961,11 +8107,11 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'An imaginary literal yields a complex number with a real part '
'of 0.0.\n'
- 'Complex numbers are represented as a pair of floating point '
+ 'Complex numbers are represented as a pair of floating-point '
'numbers\n'
'and have the same restrictions on their range. To create a '
'complex\n'
- 'number with a nonzero real part, add a floating point number to '
+ 'number with a nonzero real part, add a floating-point number to '
'it,\n'
'e.g., "(3+4j)". Some examples of imaginary literals:\n'
'\n'
@@ -8351,7 +8497,8 @@ topics = {'assert': 'The "assert" statement\n'
'in\n'
'square brackets:\n'
'\n'
- ' list_display ::= "[" [starred_list | comprehension] "]"\n'
+ ' list_display ::= "[" [flexible_expression_list | comprehension] '
+ '"]"\n'
'\n'
'A list display yields a new list object, the contents being '
'specified\n'
@@ -8545,15 +8692,18 @@ topics = {'assert': 'The "assert" statement\n'
'Annotation scopes\n'
'=================\n'
'\n'
- 'Type parameter lists and "type" statements introduce *annotation\n'
- 'scopes*, which behave mostly like function scopes, but with some\n'
- 'exceptions discussed below. *Annotations* currently do not use\n'
- 'annotation scopes, but they are expected to use annotation scopes '
- 'in\n'
- 'Python 3.13 when **PEP 649** is implemented.\n'
+ '*Annotations*, type parameter lists and "type" statements '
+ 'introduce\n'
+ '*annotation scopes*, which behave mostly like function scopes, '
+ 'but\n'
+ 'with some exceptions discussed below.\n'
'\n'
'Annotation scopes are used in the following contexts:\n'
'\n'
+ '* *Function annotations*.\n'
+ '\n'
+ '* *Variable annotations*.\n'
+ '\n'
'* Type parameter lists for generic type aliases.\n'
'\n'
'* Type parameter lists for generic functions. A generic '
@@ -8602,11 +8752,9 @@ topics = {'assert': 'The "assert" statement\n'
' can introduce new names.\n'
'\n'
'* While annotation scopes have an internal name, that name is not\n'
- ' reflected in the *__qualname__* of objects defined within the '
- 'scope.\n'
- ' Instead, the "__qualname__" of such objects is as if the object '
- 'were\n'
- ' defined in the enclosing scope.\n'
+ ' reflected in the *qualified name* of objects defined within the\n'
+ ' scope. Instead, the "__qualname__" of such objects is as if the\n'
+ ' object were defined in the enclosing scope.\n'
'\n'
'Added in version 3.12: Annotation scopes were introduced in '
'Python\n'
@@ -8615,21 +8763,25 @@ topics = {'assert': 'The "assert" statement\n'
'Changed in version 3.13: Annotation scopes are also used for type\n'
'parameter defaults, as introduced by **PEP 696**.\n'
'\n'
+ 'Changed in version 3.14: Annotation scopes are now also used for\n'
+ 'annotations, as specified in **PEP 649** and **PEP 749**.\n'
+ '\n'
'\n'
'Lazy evaluation\n'
'===============\n'
'\n'
- 'The values of type aliases created through the "type" statement '
- 'are\n'
- '*lazily evaluated*. The same applies to the bounds, constraints, '
- 'and\n'
- 'default values of type variables created through the type '
- 'parameter\n'
- 'syntax. This means that they are not evaluated when the type alias '
- 'or\n'
- 'type variable is created. Instead, they are only evaluated when '
- 'doing\n'
- 'so is necessary to resolve an attribute access.\n'
+ 'Most annotation scopes are *lazily evaluated*. This includes\n'
+ 'annotations, the values of type aliases created through the '
+ '"type"\n'
+ 'statement, and the bounds, constraints, and default values of '
+ 'type\n'
+ 'variables created through the type parameter syntax. This means '
+ 'that\n'
+ 'they are not evaluated when the type alias or type variable is\n'
+ 'created, or when the object carrying annotations is created. '
+ 'Instead,\n'
+ 'they are only evaluated when necessary, for example when the\n'
+ '"__value__" attribute on a type alias is accessed.\n'
'\n'
'Example:\n'
'\n'
@@ -8762,8 +8914,8 @@ topics = {'assert': 'The "assert" statement\n'
'numbers': 'Numeric literals\n'
'****************\n'
'\n'
- 'There are three types of numeric literals: integers, floating '
- 'point\n'
+ 'There are three types of numeric literals: integers, '
+ 'floating-point\n'
'numbers, and imaginary numbers. There are no complex literals\n'
'(complex numbers can be formed by adding a real number and an\n'
'imaginary number).\n'
@@ -8969,13 +9121,9 @@ topics = {'assert': 'The "assert" statement\n'
' of the object truncated to an "Integral" (typically an '
'"int").\n'
'\n'
- ' The built-in function "int()" falls back to '
- '"__trunc__()" if\n'
- ' neither "__int__()" nor "__index__()" is defined.\n'
- '\n'
- ' Changed in version 3.11: The delegation of "int()" to '
- '"__trunc__()"\n'
- ' is deprecated.\n',
+ ' Changed in version 3.14: "int()" no longer delegates to '
+ 'the\n'
+ ' "__trunc__()" method.\n',
'objects': 'Objects, values and types\n'
'*************************\n'
'\n'
@@ -9095,16 +9243,22 @@ topics = {'assert': 'The "assert" statement\n'
'types, operations that compute new values may actually return a\n'
'reference to any existing object with the same type and value, '
'while\n'
- 'for mutable objects this is not allowed. E.g., after "a = 1; b = '
- '1",\n'
- '"a" and "b" may or may not refer to the same object with the '
- 'value\n'
- 'one, depending on the implementation, but after "c = []; d = []", '
- '"c"\n'
- 'and "d" are guaranteed to refer to two different, unique, newly\n'
- 'created empty lists. (Note that "c = d = []" assigns the same '
- 'object\n'
- 'to both "c" and "d".)\n',
+ 'for mutable objects this is not allowed. For example, after "a = '
+ '1; b\n'
+ '= 1", *a* and *b* may or may not refer to the same object with '
+ 'the\n'
+ 'value one, depending on the implementation. This is because "int" '
+ 'is\n'
+ 'an immutable type, so the reference to "1" can be reused. This\n'
+ 'behaviour depends on the implementation used, so should not be '
+ 'relied\n'
+ 'upon, but is something to be aware of when making use of object\n'
+ 'identity tests. However, after "c = []; d = []", *c* and *d* are\n'
+ 'guaranteed to refer to two different, unique, newly created '
+ 'empty\n'
+ 'lists. (Note that "e = f = []" assigns the *same* object to both '
+ '*e*\n'
+ 'and *f*.)\n',
'operator-summary': 'Operator precedence\n'
'*******************\n'
'\n'
@@ -9333,8 +9487,8 @@ topics = {'assert': 'The "assert" statement\n'
'"complex"\n'
'number. (In earlier versions it raised a "ValueError".)\n'
'\n'
- 'This operation can be customized using the special "__pow__()" '
- 'method.\n',
+ 'This operation can be customized using the special "__pow__()" and\n'
+ '"__rpow__()" methods.\n',
'raise': 'The "raise" statement\n'
'*********************\n'
'\n'
@@ -9748,9 +9902,12 @@ topics = {'assert': 'The "assert" statement\n'
'the\n'
'second argument.\n'
'\n'
- 'This operation can be customized using the special '
- '"__lshift__()" and\n'
- '"__rshift__()" methods.\n'
+ 'The left shift operation can be customized using the special\n'
+ '"__lshift__()" and "__rlshift__()" methods. The right shift '
+ 'operation\n'
+ 'can be customized using the special "__rshift__()" and '
+ '"__rrshift__()"\n'
+ 'methods.\n'
'\n'
'A right shift by *n* bits is defined as floor division by '
'"pow(2,n)".\n'
@@ -9816,20 +9973,6 @@ topics = {'assert': 'The "assert" statement\n'
'not reported\n'
'by the "dir()" built-in function.\n'
'\n'
- 'object.__dict__\n'
- '\n'
- ' A dictionary or other mapping object used to store an '
- 'object’s\n'
- ' (writable) attributes.\n'
- '\n'
- 'instance.__class__\n'
- '\n'
- ' The class to which a class instance belongs.\n'
- '\n'
- 'class.__bases__\n'
- '\n'
- ' The tuple of base classes of a class object.\n'
- '\n'
'definition.__name__\n'
'\n'
' The name of the class, function, method, descriptor, or '
@@ -9844,47 +9987,26 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
' Added in version 3.3.\n'
'\n'
- 'definition.__type_params__\n'
- '\n'
- ' The type parameters of generic classes, functions, and '
- 'type\n'
- ' aliases.\n'
- '\n'
- ' Added in version 3.12.\n'
- '\n'
- 'class.__mro__\n'
+ 'definition.__module__\n'
'\n'
- ' This attribute is a tuple of classes that are considered '
- 'when\n'
- ' looking for base classes during method resolution.\n'
+ ' The name of the module in which a class or function was '
+ 'defined.\n'
'\n'
- 'class.mro()\n'
- '\n'
- ' This method can be overridden by a metaclass to customize '
- 'the\n'
- ' method resolution order for its instances. It is called '
- 'at class\n'
- ' instantiation, and its result is stored in "__mro__".\n'
+ 'definition.__doc__\n'
'\n'
- 'class.__subclasses__()\n'
+ ' The documentation string of a class or function, or '
+ '"None" if\n'
+ ' undefined.\n'
'\n'
- ' Each class keeps a list of weak references to its '
- 'immediate\n'
- ' subclasses. This method returns a list of all those '
- 'references\n'
- ' still alive. The list is in definition order. Example:\n'
- '\n'
- ' >>> int.__subclasses__()\n'
- " [<class 'bool'>, <enum 'IntEnum'>, <flag 'IntFlag'>, "
- "<class 're._constants._NamedIntConstant'>]\n"
- '\n'
- 'class.__static_attributes__\n'
+ 'definition.__type_params__\n'
'\n'
- ' A tuple containing names of attributes of this class '
- 'which are\n'
- ' accessed through "self.X" from any function in its body.\n'
+ ' The type parameters of generic classes, functions, and '
+ 'type\n'
+ ' aliases. For classes and functions that are not generic, '
+ 'this will\n'
+ ' be an empty tuple.\n'
'\n'
- ' Added in version 3.13.\n',
+ ' Added in version 3.12.\n',
'specialnames': 'Special method names\n'
'********************\n'
'\n'
@@ -10028,6 +10150,10 @@ topics = {'assert': 'The "assert" statement\n'
' It is not guaranteed that "__del__()" methods are called '
'for\n'
' objects that still exist when the interpreter exits.\n'
+ ' "weakref.finalize" provides a straightforward way to '
+ 'register a\n'
+ ' cleanup function to be called when an object is garbage '
+ 'collected.\n'
'\n'
' Note:\n'
'\n'
@@ -10826,11 +10952,13 @@ topics = {'assert': 'The "assert" statement\n'
'the class\n'
' where it is defined. *__slots__* declared in parents are '
'available\n'
- ' in child classes. However, child subclasses will get a '
- '"__dict__"\n'
- ' and *__weakref__* unless they also define *__slots__* '
- '(which should\n'
- ' only contain names of any *additional* slots).\n'
+ ' in child classes. However, instances of a child subclass '
+ 'will get a\n'
+ ' "__dict__" and *__weakref__* unless the subclass also '
+ 'defines\n'
+ ' *__slots__* (which should only contain names of any '
+ '*additional*\n'
+ ' slots).\n'
'\n'
'* If a class defines a slot also defined in a base class, '
'the instance\n'
@@ -11247,7 +11375,7 @@ topics = {'assert': 'The "assert" statement\n'
'built-in\n'
'types), including other ABCs.\n'
'\n'
- 'class.__instancecheck__(self, instance)\n'
+ 'type.__instancecheck__(self, instance)\n'
'\n'
' Return true if *instance* should be considered a (direct '
'or\n'
@@ -11255,7 +11383,7 @@ topics = {'assert': 'The "assert" statement\n'
'implement\n'
' "isinstance(instance, class)".\n'
'\n'
- 'class.__subclasscheck__(self, subclass)\n'
+ 'type.__subclasscheck__(self, subclass)\n'
'\n'
' Return true if *subclass* should be considered a (direct '
'or\n'
@@ -11909,13 +12037,9 @@ topics = {'assert': 'The "assert" statement\n'
' of the object truncated to an "Integral" (typically an '
'"int").\n'
'\n'
- ' The built-in function "int()" falls back to "__trunc__()" '
- 'if\n'
- ' neither "__int__()" nor "__index__()" is defined.\n'
- '\n'
- ' Changed in version 3.11: The delegation of "int()" to '
- '"__trunc__()"\n'
- ' is deprecated.\n'
+ ' Changed in version 3.14: "int()" no longer delegates to '
+ 'the\n'
+ ' "__trunc__()" method.\n'
'\n'
'\n'
'With Statement Context Managers\n'
@@ -12082,6 +12206,71 @@ topics = {'assert': 'The "assert" statement\n'
' ABC for buffer types.\n'
'\n'
'\n'
+ 'Annotations\n'
+ '===========\n'
+ '\n'
+ 'Functions, classes, and modules may contain *annotations*, '
+ 'which are a\n'
+ 'way to associate information (usually *type hints*) with a '
+ 'symbol.\n'
+ '\n'
+ 'object.__annotations__\n'
+ '\n'
+ ' This attribute contains the annotations for an object. It '
+ 'is lazily\n'
+ ' evaluated, so accessing the attribute may execute '
+ 'arbitrary code\n'
+ ' and raise exceptions. If evaluation is successful, the '
+ 'attribute is\n'
+ ' set to a dictionary mapping from variable names to '
+ 'annotations.\n'
+ '\n'
+ ' Changed in version 3.14: Annotations are now lazily '
+ 'evaluated.\n'
+ '\n'
+ 'object.__annotate__(format)\n'
+ '\n'
+ ' An *annotate function*. Returns a new dictionary object '
+ 'mapping\n'
+ ' attribute/parameter names to their annotation values.\n'
+ '\n'
+ ' Takes a format parameter specifying the format in which '
+ 'annotations\n'
+ ' values should be provided. It must be a member of the\n'
+ ' "annotationlib.Format" enum, or an integer with a value\n'
+ ' corresponding to a member of the enum.\n'
+ '\n'
+ ' If an annotate function doesn’t support the requested '
+ 'format, it\n'
+ ' must raise "NotImplementedError". Annotate functions must '
+ 'always\n'
+ ' support "VALUE" format; they must not raise '
+ '"NotImplementedError()"\n'
+ ' when called with this format.\n'
+ '\n'
+ ' When called with "VALUE" format, an annotate function '
+ 'may raise\n'
+ ' "NameError"; it must not raise "NameError" when called '
+ 'requesting\n'
+ ' any other format.\n'
+ '\n'
+ ' If an object does not have any annotations, '
+ '"__annotate__" should\n'
+ ' preferably be set to "None" (it can’t be deleted), rather '
+ 'than set\n'
+ ' to a function that returns an empty dict.\n'
+ '\n'
+ ' Added in version 3.14.\n'
+ '\n'
+ 'See also:\n'
+ '\n'
+ ' **PEP 649** — Deferred evaluation of annotation using '
+ 'descriptors\n'
+ ' Introduces lazy evaluation of annotations and the '
+ '"__annotate__"\n'
+ ' function.\n'
+ '\n'
+ '\n'
'Special method lookup\n'
'=====================\n'
'\n'
@@ -12400,7 +12589,7 @@ topics = {'assert': 'The "assert" statement\n'
'the\n'
' "LC_NUMERIC" locale in some cases.\n'
'\n'
- 'str.format_map(mapping)\n'
+ 'str.format_map(mapping, /)\n'
'\n'
' Similar to "str.format(**mapping)", except that '
'"mapping" is used\n'
@@ -12828,11 +13017,11 @@ topics = {'assert': 'The "assert" statement\n'
' and are deemed to delimit empty strings (for example,\n'
' "\'1,,2\'.split(\',\')" returns "[\'1\', \'\', '
'\'2\']"). The *sep* argument\n'
- ' may consist of multiple characters (for example,\n'
- ' "\'1<>2<>3\'.split(\'<>\')" returns "[\'1\', \'2\', '
- '\'3\']"). Splitting an\n'
- ' empty string with a specified separator returns '
- '"[\'\']".\n'
+ ' may consist of multiple characters as a single '
+ 'delimiter (to split\n'
+ ' with multiple delimiters, use "re.split()"). Splitting '
+ 'an empty\n'
+ ' string with a specified separator returns "[\'\']".\n'
'\n'
' For example:\n'
'\n'
@@ -12842,6 +13031,8 @@ topics = {'assert': 'The "assert" statement\n'
" ['1', '2,3']\n"
" >>> '1,2,,3,'.split(',')\n"
" ['1', '2', '', '3', '']\n"
+ " >>> '1<>2<>3<4'.split('<>')\n"
+ " ['1', '2', '3<4']\n"
'\n'
' If *sep* is not specified or is "None", a different '
'splitting\n'
@@ -13184,15 +13375,13 @@ topics = {'assert': 'The "assert" statement\n'
'greater must be expressed with escapes.\n'
'\n'
'Both string and bytes literals may optionally be prefixed with a\n'
- 'letter "\'r\'" or "\'R\'"; such strings are called *raw strings* '
- 'and treat\n'
- 'backslashes as literal characters. As a result, in string '
- 'literals,\n'
- '"\'\\U\'" and "\'\\u\'" escapes in raw strings are not treated '
- 'specially.\n'
- 'Given that Python 2.x’s raw unicode literals behave differently '
- 'than\n'
- 'Python 3.x’s the "\'ur\'" syntax is not supported.\n'
+ 'letter "\'r\'" or "\'R\'"; such constructs are called *raw '
+ 'string\n'
+ 'literals* and *raw bytes literals* respectively and treat '
+ 'backslashes\n'
+ 'as literal characters. As a result, in raw string literals, '
+ '"\'\\U\'"\n'
+ 'and "\'\\u\'" escapes are not treated specially.\n'
'\n'
'Added in version 3.3: The "\'rb\'" prefix of raw bytes literals '
'has been\n'
@@ -13383,7 +13572,8 @@ topics = {'assert': 'The "assert" statement\n'
'*generic\n'
'class* will generally return a GenericAlias object.\n'
'\n'
- ' subscription ::= primary "[" expression_list "]"\n'
+ ' subscription ::= primary "[" flexible_expression_list '
+ '"]"\n'
'\n'
'When an object is subscripted, the interpreter will '
'evaluate the\n'
@@ -13402,13 +13592,18 @@ topics = {'assert': 'The "assert" statement\n'
'see\n'
'__class_getitem__ versus __getitem__.\n'
'\n'
- 'If the expression list contains at least one comma, it will '
- 'evaluate\n'
- 'to a "tuple" containing the items of the expression list. '
- 'Otherwise,\n'
- 'the expression list will evaluate to the value of the '
- 'list’s sole\n'
- 'member.\n'
+ 'If the expression list contains at least one comma, or if '
+ 'any of the\n'
+ 'expressions are starred, the expression list will evaluate '
+ 'to a\n'
+ '"tuple" containing the items of the expression list. '
+ 'Otherwise, the\n'
+ 'expression list will evaluate to the value of the list’s '
+ 'sole member.\n'
+ '\n'
+ 'Changed in version 3.11: Expressions in an expression list '
+ 'may be\n'
+ 'starred. See **PEP 646**.\n'
'\n'
'For built-in objects, there are two types of objects that '
'support\n'
@@ -13522,14 +13717,15 @@ topics = {'assert': 'The "assert" statement\n'
'clauses in turn until one is found that matches the exception. An\n'
'expression-less "except" clause, if present, must be last; it '
'matches\n'
- 'any exception. For an "except" clause with an expression, that\n'
- 'expression is evaluated, and the clause matches the exception if the\n'
- 'resulting object is “compatible” with the exception. An object is\n'
- 'compatible with an exception if the object is the class or a *non-\n'
- 'virtual base class* of the exception object, or a tuple containing '
- 'an\n'
- 'item that is the class or a non-virtual base class of the exception\n'
- 'object.\n'
+ 'any exception.\n'
+ '\n'
+ 'For an "except" clause with an expression, the expression must\n'
+ 'evaluate to an exception type or a tuple of exception types. The\n'
+ 'raised exception matches an "except" clause whose expression '
+ 'evaluates\n'
+ 'to the class or a *non-virtual base class* of the exception object, '
+ 'or\n'
+ 'to a tuple that contains such a class.\n'
'\n'
'If no "except" clause matches the exception, the search for an\n'
'exception handler continues in the surrounding code and on the\n'
@@ -13658,12 +13854,13 @@ topics = {'assert': 'The "assert" statement\n'
' ...\n'
" ExceptionGroup('', (BlockingIOError()))\n"
'\n'
- 'An "except*" clause must have a matching type, and this type cannot '
- 'be\n'
- 'a subclass of "BaseExceptionGroup". It is not possible to mix '
- '"except"\n'
- 'and "except*" in the same "try". "break", "continue" and "return"\n'
- 'cannot appear in an "except*" clause.\n'
+ 'An "except*" clause must have a matching expression; it cannot be\n'
+ '"except*:". Furthermore, this expression cannot contain exception\n'
+ 'group types, because that would have ambiguous semantics.\n'
+ '\n'
+ 'It is not possible to mix "except" and "except*" in the same "try".\n'
+ '"break", "continue" and "return" cannot appear in an "except*" '
+ 'clause.\n'
'\n'
'\n'
'"else" clause\n'
@@ -13778,11 +13975,12 @@ topics = {'assert': 'The "assert" statement\n'
'See Implementing the arithmetic operations for more details.\n'
'\n'
'Changed in version 3.9: Evaluating "NotImplemented" in a boolean\n'
- 'context is deprecated. While it currently evaluates as true, it '
- 'will\n'
- 'emit a "DeprecationWarning". It will raise a "TypeError" in a '
- 'future\n'
- 'version of Python.\n'
+ 'context was deprecated.\n'
+ '\n'
+ 'Changed in version 3.14: Evaluating "NotImplemented" in a boolean\n'
+ 'context now raises a "TypeError". It previously evaluated to '
+ '"True"\n'
+ 'and emitted a "DeprecationWarning" since Python 3.9.\n'
'\n'
'\n'
'Ellipsis\n'
@@ -13824,7 +14022,7 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'* A sign is shown only when the number is negative.\n'
'\n'
- 'Python distinguishes between integers, floating point numbers, and\n'
+ 'Python distinguishes between integers, floating-point numbers, and\n'
'complex numbers:\n'
'\n'
'\n'
@@ -13869,28 +14067,28 @@ topics = {'assert': 'The "assert" statement\n'
'"numbers.Real" ("float")\n'
'------------------------\n'
'\n'
- 'These represent machine-level double precision floating point '
+ 'These represent machine-level double precision floating-point '
'numbers.\n'
'You are at the mercy of the underlying machine architecture (and C '
'or\n'
'Java implementation) for the accepted range and handling of '
'overflow.\n'
- 'Python does not support single-precision floating point numbers; '
+ 'Python does not support single-precision floating-point numbers; '
'the\n'
'savings in processor and memory usage that are usually the reason '
'for\n'
'using these are dwarfed by the overhead of using objects in Python, '
'so\n'
'there is no reason to complicate the language with two kinds of\n'
- 'floating point numbers.\n'
+ 'floating-point numbers.\n'
'\n'
'\n'
'"numbers.Complex" ("complex")\n'
'-----------------------------\n'
'\n'
'These represent complex numbers as a pair of machine-level double\n'
- 'precision floating point numbers. The same caveats apply as for\n'
- 'floating point numbers. The real and imaginary parts of a complex\n'
+ 'precision floating-point numbers. The same caveats apply as for\n'
+ 'floating-point numbers. The real and imaginary parts of a complex\n'
'number "z" can be retrieved through the read-only attributes '
'"z.real"\n'
'and "z.imag".\n'
@@ -14084,8 +14282,7 @@ topics = {'assert': 'The "assert" statement\n'
'however removing a key and re-inserting it will add it to the end\n'
'instead of keeping its old place.\n'
'\n'
- 'Dictionaries are mutable; they can be created by the "{...}" '
- 'notation\n'
+ 'Dictionaries are mutable; they can be created by the "{}" notation\n'
'(see section Dictionary displays).\n'
'\n'
'The extension modules "dbm.ndbm" and "dbm.gnu" provide additional\n'
@@ -14135,13 +14332,15 @@ topics = {'assert': 'The "assert" statement\n'
'| function.__closure__ | "None" or a '
'"tuple" of cells that contain bindings |\n'
'| | for the '
- 'function’s free variables. A cell object |\n'
- '| | has the '
- 'attribute "cell_contents". This can be |\n'
- '| | used to get '
- 'the value of the cell, as well as set |\n'
- '| | the '
- 'value. |\n'
+ 'names specified in the "co_freevars" |\n'
+ '| | attribute of '
+ 'the function’s "code object". A cell |\n'
+ '| | object has '
+ 'the attribute "cell_contents". This can |\n'
+ '| | be used to '
+ 'get the value of the cell, as well as |\n'
+ '| | set the '
+ 'value. |\n'
'+----------------------------------------------------+----------------------------------------------------+\n'
'\n'
'\n'
@@ -14156,8 +14355,8 @@ topics = {'assert': 'The "assert" statement\n'
'|====================================================|====================================================|\n'
'| function.__doc__ | The '
'function’s documentation string, or "None" if |\n'
- '| | unavailable. '
- 'Not inherited by subclasses. |\n'
+ '| | '
+ 'unavailable. |\n'
'+----------------------------------------------------+----------------------------------------------------+\n'
'| function.__name__ | The '
'function’s name. See also: "__name__ |\n'
@@ -14198,9 +14397,20 @@ topics = {'assert': 'The "assert" statement\n'
'| | parameter '
'names, and "\'return\'" for the return |\n'
'| | annotation, '
- 'if provided. See also: Annotations |\n'
- '| | Best '
- 'Practices. |\n'
+ 'if provided. See also: |\n'
+ '| | '
+ '"object.__annotations__". Changed in version |\n'
+ '| | 3.14: '
+ 'Annotations are now lazily evaluated. See |\n'
+ '| | **PEP '
+ '649**. |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| function.__annotate__ | The '
+ '*annotate function* for this function, or |\n'
+ '| | "None" if '
+ 'the function has no annotations. See |\n'
+ '| | '
+ '"object.__annotate__". Added in version 3.14. |\n'
'+----------------------------------------------------+----------------------------------------------------+\n'
'| function.__kwdefaults__ | A '
'"dictionary" containing defaults for keyword- |\n'
@@ -14305,21 +14515,10 @@ topics = {'assert': 'The "assert" statement\n'
'to\n'
'calling "f(C,1)" where "f" is the underlying function.\n'
'\n'
- 'Note that the transformation from function object to instance '
- 'method\n'
- 'object happens each time the attribute is retrieved from the '
- 'instance.\n'
- 'In some cases, a fruitful optimization is to assign the attribute '
- 'to a\n'
- 'local variable and call that local variable. Also notice that this\n'
- 'transformation only happens for user-defined functions; other '
- 'callable\n'
- 'objects (and all non-callable objects) are retrieved without\n'
- 'transformation. It is also important to note that user-defined\n'
- 'functions which are attributes of a class instance are not '
- 'converted\n'
- 'to bound methods; this *only* happens when the function is an\n'
- 'attribute of the class.\n'
+ 'It is important to note that user-defined functions which are\n'
+ 'attributes of a class instance are not converted to bound methods;\n'
+ 'this *only* happens when the function is an attribute of the '
+ 'class.\n'
'\n'
'\n'
'Generator functions\n'
@@ -14456,43 +14655,279 @@ topics = {'assert': 'The "assert" statement\n'
'e.g.,\n'
'"m.x = 1" is equivalent to "m.__dict__["x"] = 1".\n'
'\n'
- 'Predefined (writable) attributes:\n'
'\n'
- ' "__name__"\n'
- ' The module’s name.\n'
+ 'Import-related attributes on module objects\n'
+ '-------------------------------------------\n'
+ '\n'
+ 'Module objects have the following attributes that relate to the '
+ 'import\n'
+ 'system. When a module is created using the machinery associated '
+ 'with\n'
+ 'the import system, these attributes are filled in based on the\n'
+ 'module’s *spec*, before the *loader* executes and loads the '
+ 'module.\n'
+ '\n'
+ 'To create a module dynamically rather than using the import '
+ 'system,\n'
+ 'it’s recommended to use "importlib.util.module_from_spec()", which\n'
+ 'will set the various import-controlled attributes to appropriate\n'
+ 'values. It’s also possible to use the "types.ModuleType" '
+ 'constructor\n'
+ 'to create modules directly, but this technique is more error-prone, '
+ 'as\n'
+ 'most attributes must be manually set on the module object after it '
+ 'has\n'
+ 'been created when using this approach.\n'
+ '\n'
+ 'Caution:\n'
+ '\n'
+ ' With the exception of "__name__", it is **strongly** recommended\n'
+ ' that you rely on "__spec__" and its attributes instead of any of '
+ 'the\n'
+ ' other individual attributes listed in this subsection. Note that\n'
+ ' updating an attribute on "__spec__" will not update the\n'
+ ' corresponding attribute on the module itself:\n'
+ '\n'
+ ' >>> import typing\n'
+ ' >>> typing.__name__, typing.__spec__.name\n'
+ " ('typing', 'typing')\n"
+ " >>> typing.__spec__.name = 'spelling'\n"
+ ' >>> typing.__name__, typing.__spec__.name\n'
+ " ('typing', 'spelling')\n"
+ " >>> typing.__name__ = 'keyboard_smashing'\n"
+ ' >>> typing.__name__, typing.__spec__.name\n'
+ " ('keyboard_smashing', 'spelling')\n"
+ '\n'
+ 'module.__name__\n'
+ '\n'
+ ' The name used to uniquely identify the module in the import '
+ 'system.\n'
+ ' For a directly executed module, this will be set to '
+ '""__main__"".\n'
+ '\n'
+ ' This attribute must be set to the fully qualified name of the\n'
+ ' module. It is expected to match the value of\n'
+ ' "module.__spec__.name".\n'
+ '\n'
+ 'module.__spec__\n'
+ '\n'
+ ' A record of the module’s import-system-related state.\n'
+ '\n'
+ ' Set to the "module spec" that was used when importing the '
+ 'module.\n'
+ ' See Module specs for more details.\n'
+ '\n'
+ ' Added in version 3.4.\n'
+ '\n'
+ 'module.__package__\n'
+ '\n'
+ ' The *package* a module belongs to.\n'
+ '\n'
+ ' If the module is top-level (that is, not a part of any specific\n'
+ ' package) then the attribute should be set to "\'\'" (the empty\n'
+ ' string). Otherwise, it should be set to the name of the '
+ 'module’s\n'
+ ' package (which can be equal to "module.__name__" if the module\n'
+ ' itself is a package). See **PEP 366** for further details.\n'
+ '\n'
+ ' This attribute is used instead of "__name__" to calculate '
+ 'explicit\n'
+ ' relative imports for main modules. It defaults to "None" for\n'
+ ' modules created dynamically using the "types.ModuleType"\n'
+ ' constructor; use "importlib.util.module_from_spec()" instead to\n'
+ ' ensure the attribute is set to a "str".\n'
+ '\n'
+ ' It is **strongly** recommended that you use\n'
+ ' "module.__spec__.parent" instead of "module.__package__".\n'
+ ' "__package__" is now only used as a fallback if '
+ '"__spec__.parent"\n'
+ ' is not set, and this fallback path is deprecated.\n'
+ '\n'
+ ' Changed in version 3.4: This attribute now defaults to "None" '
+ 'for\n'
+ ' modules created dynamically using the "types.ModuleType"\n'
+ ' constructor. Previously the attribute was optional.\n'
+ '\n'
+ ' Changed in version 3.6: The value of "__package__" is expected '
+ 'to\n'
+ ' be the same as "__spec__.parent". "__package__" is now only used '
+ 'as\n'
+ ' a fallback during import resolution if "__spec__.parent" is not\n'
+ ' defined.\n'
+ '\n'
+ ' Changed in version 3.10: "ImportWarning" is raised if an import\n'
+ ' resolution falls back to "__package__" instead of\n'
+ ' "__spec__.parent".\n'
+ '\n'
+ ' Changed in version 3.12: Raise "DeprecationWarning" instead of\n'
+ ' "ImportWarning" when falling back to "__package__" during '
+ 'import\n'
+ ' resolution.\n'
+ '\n'
+ ' Deprecated since version 3.13, will be removed in version 3.15:\n'
+ ' "__package__" will cease to be set or taken into consideration '
+ 'by\n'
+ ' the import system or standard library.\n'
+ '\n'
+ 'module.__loader__\n'
+ '\n'
+ ' The *loader* object that the import machinery used to load the\n'
+ ' module.\n'
'\n'
- ' "__doc__"\n'
- ' The module’s documentation string, or "None" if unavailable.\n'
+ ' This attribute is mostly useful for introspection, but can be '
+ 'used\n'
+ ' for additional loader-specific functionality, for example '
+ 'getting\n'
+ ' data associated with a loader.\n'
+ '\n'
+ ' "__loader__" defaults to "None" for modules created dynamically\n'
+ ' using the "types.ModuleType" constructor; use\n'
+ ' "importlib.util.module_from_spec()" instead to ensure the '
+ 'attribute\n'
+ ' is set to a *loader* object.\n'
'\n'
- ' "__file__"\n'
- ' The pathname of the file from which the module was loaded, if '
- 'it\n'
- ' was loaded from a file. The "__file__" attribute may be '
- 'missing\n'
- ' for certain types of modules, such as C modules that are\n'
- ' statically linked into the interpreter. For extension '
+ ' It is **strongly** recommended that you use\n'
+ ' "module.__spec__.loader" instead of "module.__loader__".\n'
+ '\n'
+ ' Changed in version 3.4: This attribute now defaults to "None" '
+ 'for\n'
+ ' modules created dynamically using the "types.ModuleType"\n'
+ ' constructor. Previously the attribute was optional.\n'
+ '\n'
+ ' Deprecated since version 3.12, removed in version 3.14: Setting\n'
+ ' "__loader__" on a module while failing to set "__spec__.loader" '
+ 'is\n'
+ ' deprecated. In Python 3.14, "__loader__" will cease to be set '
+ 'or\n'
+ ' taken into consideration by the import system or the standard\n'
+ ' library.\n'
+ '\n'
+ 'module.__path__\n'
+ '\n'
+ ' A (possibly empty) *sequence* of strings enumerating the '
+ 'locations\n'
+ ' where the package’s submodules will be found. Non-package '
'modules\n'
- ' loaded dynamically from a shared library, it’s the pathname '
- 'of\n'
- ' the shared library file.\n'
+ ' should not have a "__path__" attribute. See __path__ attributes '
+ 'on\n'
+ ' modules for more details.\n'
'\n'
- ' "__annotations__"\n'
- ' A dictionary containing *variable annotations* collected '
- 'during\n'
- ' module body execution. For best practices on working with\n'
- ' "__annotations__", please see Annotations Best Practices.\n'
+ ' It is **strongly** recommended that you use\n'
+ ' "module.__spec__.submodule_search_locations" instead of\n'
+ ' "module.__path__".\n'
'\n'
- 'Special read-only attribute: "__dict__" is the module’s namespace '
- 'as a\n'
- 'dictionary object.\n'
+ 'module.__file__\n'
'\n'
- '**CPython implementation detail:** Because of the way CPython '
- 'clears\n'
- 'module dictionaries, the module dictionary will be cleared when '
+ 'module.__cached__\n'
+ '\n'
+ ' "__file__" and "__cached__" are both optional attributes that '
+ 'may\n'
+ ' or may not be set. Both attributes should be a "str" when they '
+ 'are\n'
+ ' available.\n'
+ '\n'
+ ' "__file__" indicates the pathname of the file from which the '
+ 'module\n'
+ ' was loaded (if loaded from a file), or the pathname of the '
+ 'shared\n'
+ ' library file for extension modules loaded dynamically from a '
+ 'shared\n'
+ ' library. It might be missing for certain types of modules, such '
+ 'as\n'
+ ' C modules that are statically linked into the interpreter, and '
'the\n'
- 'module falls out of scope even if the dictionary still has live\n'
- 'references. To avoid this, copy the dictionary or keep the module\n'
- 'around while using its dictionary directly.\n'
+ ' import system may opt to leave it unset if it has no semantic\n'
+ ' meaning (for example, a module loaded from a database).\n'
+ '\n'
+ ' If "__file__" is set then the "__cached__" attribute might also '
+ 'be\n'
+ ' set, which is the path to any compiled version of the code '
+ '(for\n'
+ ' example, a byte-compiled file). The file does not need to exist '
+ 'to\n'
+ ' set this attribute; the path can simply point to where the '
+ 'compiled\n'
+ ' file *would* exist (see **PEP 3147**).\n'
+ '\n'
+ ' Note that "__cached__" may be set even if "__file__" is not '
+ 'set.\n'
+ ' However, that scenario is quite atypical. Ultimately, the '
+ '*loader*\n'
+ ' is what makes use of the module spec provided by the *finder* '
+ '(from\n'
+ ' which "__file__" and "__cached__" are derived). So if a loader '
+ 'can\n'
+ ' load from a cached module but otherwise does not load from a '
+ 'file,\n'
+ ' that atypical scenario may be appropriate.\n'
+ '\n'
+ ' It is **strongly** recommended that you use\n'
+ ' "module.__spec__.cached" instead of "module.__cached__".\n'
+ '\n'
+ ' Deprecated since version 3.13, will be removed in version 3.15:\n'
+ ' Setting "__cached__" on a module while failing to set\n'
+ ' "__spec__.cached" is deprecated. In Python 3.15, "__cached__" '
+ 'will\n'
+ ' cease to be set or taken into consideration by the import system '
+ 'or\n'
+ ' standard library.\n'
+ '\n'
+ '\n'
+ 'Other writable attributes on module objects\n'
+ '-------------------------------------------\n'
+ '\n'
+ 'As well as the import-related attributes listed above, module '
+ 'objects\n'
+ 'also have the following writable attributes:\n'
+ '\n'
+ 'module.__doc__\n'
+ '\n'
+ ' The module’s documentation string, or "None" if unavailable. '
+ 'See\n'
+ ' also: "__doc__ attributes".\n'
+ '\n'
+ 'module.__annotations__\n'
+ '\n'
+ ' A dictionary containing *variable annotations* collected during\n'
+ ' module body execution. For best practices on working with\n'
+ ' "__annotations__", see "annotationlib".\n'
+ '\n'
+ ' Changed in version 3.14: Annotations are now lazily evaluated. '
+ 'See\n'
+ ' **PEP 649**.\n'
+ '\n'
+ 'module.__annotate__\n'
+ '\n'
+ ' The *annotate function* for this module, or "None" if the '
+ 'module\n'
+ ' has no annotations. See also: "__annotate__" attributes.\n'
+ '\n'
+ ' Added in version 3.14.\n'
+ '\n'
+ '\n'
+ 'Module dictionaries\n'
+ '-------------------\n'
+ '\n'
+ 'Module objects also have the following special read-only '
+ 'attribute:\n'
+ '\n'
+ 'module.__dict__\n'
+ '\n'
+ ' The module’s namespace as a dictionary object. Uniquely among '
+ 'the\n'
+ ' attributes listed here, "__dict__" cannot be accessed as a '
+ 'global\n'
+ ' variable from within a module; it can only be accessed as an\n'
+ ' attribute on module objects.\n'
+ '\n'
+ ' **CPython implementation detail:** Because of the way CPython\n'
+ ' clears module dictionaries, the module dictionary will be '
+ 'cleared\n'
+ ' when the module falls out of scope even if the dictionary still '
+ 'has\n'
+ ' live references. To avoid this, copy the dictionary or keep '
+ 'the\n'
+ ' module around while using its dictionary directly.\n'
'\n'
'\n'
'Custom classes\n'
@@ -14538,41 +14973,147 @@ topics = {'assert': 'The "assert" statement\n'
'A class object can be called (see above) to yield a class instance\n'
'(see below).\n'
'\n'
- 'Special attributes:\n'
'\n'
- ' "__name__"\n'
- ' The class name.\n'
+ 'Special attributes\n'
+ '------------------\n'
'\n'
- ' "__module__"\n'
- ' The name of the module in which the class was defined.\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| Attribute | '
+ 'Meaning |\n'
+ '|====================================================|====================================================|\n'
+ '| type.__name__ | The class’s '
+ 'name. See also: "__name__ attributes". |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| type.__qualname__ | The class’s '
+ '*qualified name*. See also: |\n'
+ '| | '
+ '"__qualname__ attributes". |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| type.__module__ | The name of '
+ 'the module in which the class was |\n'
+ '| | '
+ 'defined. |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| type.__dict__ | A "mapping '
+ 'proxy" providing a read-only view of |\n'
+ '| | the class’s '
+ 'namespace. See also: "__dict__ |\n'
+ '| | '
+ 'attributes". |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| type.__bases__ | A "tuple" '
+ 'containing the class’s bases. In most |\n'
+ '| | cases, for a '
+ 'class defined as "class X(A, B, C)", |\n'
+ '| | '
+ '"X.__bases__" will be exactly equal to "(A, B, |\n'
+ '| | '
+ 'C)". |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| type.__doc__ | The class’s '
+ 'documentation string, or "None" if |\n'
+ '| | undefined. '
+ 'Not inherited by subclasses. |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| type.__annotations__ | A dictionary '
+ 'containing *variable annotations* |\n'
+ '| | collected '
+ 'during class body execution. See also: |\n'
+ '| | '
+ '"__annotations__ attributes". For best practices |\n'
+ '| | on working '
+ 'with "__annotations__", please see |\n'
+ '| | '
+ '"annotationlib". Caution: Accessing the |\n'
+ '| | '
+ '"__annotations__" attribute of a class object |\n'
+ '| | directly may '
+ 'yield incorrect results in the |\n'
+ '| | presence of '
+ 'metaclasses. In addition, the |\n'
+ '| | attribute '
+ 'may not exist for some classes. Use |\n'
+ '| | '
+ '"annotationlib.get_annotations()" to retrieve |\n'
+ '| | class '
+ 'annotations safely. Changed in version |\n'
+ '| | 3.14: '
+ 'Annotations are now lazily evaluated. See |\n'
+ '| | **PEP '
+ '649**. |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| type.__annotate__() | The '
+ '*annotate function* for this class, or "None" |\n'
+ '| | if the class '
+ 'has no annotations. See also: |\n'
+ '| | '
+ '"__annotate__ attributes". Caution: Accessing |\n'
+ '| | the '
+ '"__annotate__" attribute of a class object |\n'
+ '| | directly may '
+ 'yield incorrect results in the |\n'
+ '| | presence of '
+ 'metaclasses. Use |\n'
+ '| | '
+ '"annotationlib.get_annotate_function()" to |\n'
+ '| | retrieve the '
+ 'annotate function safely. Added in |\n'
+ '| | version '
+ '3.14. |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| type.__type_params__ | A "tuple" '
+ 'containing the type parameters of a |\n'
+ '| | generic '
+ 'class. Added in version 3.12. |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| type.__static_attributes__ | A "tuple" '
+ 'containing names of attributes of this |\n'
+ '| | class which '
+ 'are assigned through "self.X" from any |\n'
+ '| | function in '
+ 'its body. Added in version 3.13. |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| type.__firstlineno__ | The line '
+ 'number of the first line of the class |\n'
+ '| | definition, '
+ 'including decorators. Setting the |\n'
+ '| | "__module__" '
+ 'attribute removes the |\n'
+ '| | '
+ '"__firstlineno__" item from the type’s dictionary. |\n'
+ '| | Added in '
+ 'version 3.13. |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| type.__mro__ | The "tuple" '
+ 'of classes that are considered when |\n'
+ '| | looking for '
+ 'base classes during method resolution. |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
'\n'
- ' "__dict__"\n'
- ' The dictionary containing the class’s namespace.\n'
'\n'
- ' "__bases__"\n'
- ' A tuple containing the base classes, in the order of their\n'
- ' occurrence in the base class list.\n'
+ 'Special methods\n'
+ '---------------\n'
+ '\n'
+ 'In addition to the special attributes described above, all Python\n'
+ 'classes also have the following two methods available:\n'
'\n'
- ' "__doc__"\n'
- ' The class’s documentation string, or "None" if undefined.\n'
+ 'type.mro()\n'
'\n'
- ' "__annotations__"\n'
- ' A dictionary containing *variable annotations* collected '
- 'during\n'
- ' class body execution. For best practices on working with\n'
- ' "__annotations__", please see Annotations Best Practices.\n'
+ ' This method can be overridden by a metaclass to customize the\n'
+ ' method resolution order for its instances. It is called at '
+ 'class\n'
+ ' instantiation, and its result is stored in "__mro__".\n'
'\n'
- ' "__type_params__"\n'
- ' A tuple containing the type parameters of a generic class.\n'
+ 'type.__subclasses__()\n'
'\n'
- ' "__static_attributes__"\n'
- ' A tuple containing names of attributes of this class which '
- 'are\n'
- ' accessed through "self.X" from any function in its body.\n'
+ ' Each class keeps a list of weak references to its immediate\n'
+ ' subclasses. This method returns a list of all those references\n'
+ ' still alive. The list is in definition order. Example:\n'
'\n'
- ' "__firstlineno__"\n'
- ' The line number of the first line of the class definition,\n'
- ' including decorators.\n'
+ ' >>> class A: pass\n'
+ ' >>> class B(A): pass\n'
+ ' >>> A.__subclasses__()\n'
+ " [<class 'B'>]\n"
'\n'
'\n'
'Class instances\n'
@@ -14612,8 +15153,19 @@ topics = {'assert': 'The "assert" statement\n'
'they have methods with certain special names. See section Special\n'
'method names.\n'
'\n'
- 'Special attributes: "__dict__" is the attribute dictionary;\n'
- '"__class__" is the instance’s class.\n'
+ '\n'
+ 'Special attributes\n'
+ '------------------\n'
+ '\n'
+ 'object.__class__\n'
+ '\n'
+ ' The class to which a class instance belongs.\n'
+ '\n'
+ 'object.__dict__\n'
+ '\n'
+ ' A dictionary or other mapping object used to store an object’s\n'
+ ' (writable) attributes. Not all instances have a "__dict__"\n'
+ ' attribute; see the section on __slots__ for more details.\n'
'\n'
'\n'
'I/O objects (also known as file objects)\n'
@@ -14712,14 +15264,20 @@ topics = {'assert': 'The "assert" statement\n'
'| codeobject.co_cellvars | A "tuple" '
'containing the names of local variables |\n'
'| | that are '
- 'referenced by nested functions inside the |\n'
- '| | '
- 'function |\n'
+ 'referenced from at least one *nested |\n'
+ '| | scope* '
+ 'inside the function |\n'
'+----------------------------------------------------+----------------------------------------------------+\n'
'| codeobject.co_freevars | A "tuple" '
- 'containing the names of free variables |\n'
- '| | in the '
- 'function |\n'
+ 'containing the names of *free (closure) |\n'
+ '| | variables* '
+ 'that a *nested scope* references in an |\n'
+ '| | outer scope. '
+ 'See also "function.__closure__". |\n'
+ '| | Note: '
+ 'references to global and builtin names are |\n'
+ '| | *not* '
+ 'included. |\n'
'+----------------------------------------------------+----------------------------------------------------+\n'
'| codeobject.co_code | A string '
'representing the sequence of *bytecode* |\n'
@@ -14804,10 +15362,10 @@ topics = {'assert': 'The "assert" statement\n'
' The iterator returns "tuple"s containing the "(start_line,\n'
' end_line, start_column, end_column)". The *i-th* tuple '
'corresponds\n'
- ' to the position of the source code that compiled to the *i-th*\n'
- ' instruction. Column information is 0-indexed utf-8 byte offsets '
- 'on\n'
- ' the given source line.\n'
+ ' to the position of the source code that compiled to the *i-th* '
+ 'code\n'
+ ' unit. Column information is 0-indexed utf-8 byte offsets on the\n'
+ ' given source line.\n'
'\n'
' This positional information can be missing. A non-exhaustive '
'lists\n'
@@ -14932,16 +15490,16 @@ topics = {'assert': 'The "assert" statement\n'
'| | '
'""f_code"". |\n'
'+----------------------------------------------------+----------------------------------------------------+\n'
- '| frame.f_locals | The '
- 'dictionary used by the frame to look up local |\n'
+ '| frame.f_locals | The mapping '
+ 'used by the frame to look up local |\n'
'| | variables. '
- 'If the frame refers to a function or |\n'
- '| | '
- 'comprehension, this may return a write- through |\n'
- '| | proxy '
- 'object. Changed in version 3.13: Return a |\n'
- '| | proxy for '
- 'functions and comprehensions. |\n'
+ 'If the frame refers to an *optimized |\n'
+ '| | scope*, this '
+ 'may return a write-through proxy |\n'
+ '| | object. '
+ 'Changed in version 3.13: Return a proxy |\n'
+ '| | for '
+ 'optimized scopes. |\n'
'+----------------------------------------------------+----------------------------------------------------+\n'
'| frame.f_globals | The '
'dictionary used by the frame to look up global |\n'
@@ -15223,21 +15781,23 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
' If no positional argument is given, an empty dictionary '
'is created.\n'
- ' If a positional argument is given and it is a mapping '
- 'object, a\n'
- ' dictionary is created with the same key-value pairs as '
- 'the mapping\n'
- ' object. Otherwise, the positional argument must be an '
- '*iterable*\n'
- ' object. Each item in the iterable must itself be an '
- 'iterable with\n'
- ' exactly two objects. The first object of each item '
- 'becomes a key\n'
- ' in the new dictionary, and the second object the '
- 'corresponding\n'
- ' value. If a key occurs more than once, the last value '
- 'for that key\n'
- ' becomes the corresponding value in the new dictionary.\n'
+ ' If a positional argument is given and it defines a '
+ '"keys()" method,\n'
+ ' a dictionary is created by calling "__getitem__()" on the '
+ 'argument\n'
+ ' with each returned key from the method. Otherwise, the '
+ 'positional\n'
+ ' argument must be an *iterable* object. Each item in the '
+ 'iterable\n'
+ ' must itself be an iterable with exactly two elements. '
+ 'The first\n'
+ ' element of each item becomes a key in the new dictionary, '
+ 'and the\n'
+ ' second element the corresponding value. If a key occurs '
+ 'more than\n'
+ ' once, the last value for that key becomes the '
+ 'corresponding value\n'
+ ' in the new dictionary.\n'
'\n'
' If keyword arguments are given, the keyword arguments and '
'their\n'
@@ -15350,7 +15910,7 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
' Return a shallow copy of the dictionary.\n'
'\n'
- ' classmethod fromkeys(iterable[, value])\n'
+ ' classmethod fromkeys(iterable, value=None, /)\n'
'\n'
' Create a new dictionary with keys from *iterable* and '
'values set\n'
@@ -15366,7 +15926,7 @@ topics = {'assert': 'The "assert" statement\n'
'distinct\n'
' values, use a dict comprehension instead.\n'
'\n'
- ' get(key[, default])\n'
+ ' get(key, default=None)\n'
'\n'
' Return the value for *key* if *key* is in the '
'dictionary, else\n'
@@ -15418,7 +15978,7 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
' Added in version 3.8.\n'
'\n'
- ' setdefault(key[, default])\n'
+ ' setdefault(key, default=None)\n'
'\n'
' If *key* is in the dictionary, return its value. If '
'not, insert\n'
@@ -15432,15 +15992,17 @@ topics = {'assert': 'The "assert" statement\n'
'*other*,\n'
' overwriting existing keys. Return "None".\n'
'\n'
- ' "update()" accepts either another dictionary object or '
- 'an\n'
- ' iterable of key/value pairs (as tuples or other '
- 'iterables of\n'
- ' length two). If keyword arguments are specified, the '
- 'dictionary\n'
- ' is then updated with those key/value pairs: '
- '"d.update(red=1,\n'
- ' blue=2)".\n'
+ ' "update()" accepts either another object with a '
+ '"keys()" method\n'
+ ' (in which case "__getitem__()" is called with every '
+ 'key returned\n'
+ ' from the method). or an iterable of key/value pairs '
+ '(as tuples\n'
+ ' or other iterables of length two). If keyword '
+ 'arguments are\n'
+ ' specified, the dictionary is then updated with those '
+ 'key/value\n'
+ ' pairs: "d.update(red=1, blue=2)".\n'
'\n'
' values()\n'
'\n'
@@ -16105,8 +16667,8 @@ topics = {'assert': 'The "assert" statement\n'
'| | also removes it from '
'*s* | |\n'
'+--------------------------------+----------------------------------+-----------------------+\n'
- '| "s.remove(x)" | remove the first item from '
- '*s* | (3) |\n'
+ '| "s.remove(x)" | removes the first item from '
+ '*s* | (3) |\n'
'| | where "s[i]" is equal to '
'*x* | |\n'
'+--------------------------------+----------------------------------+-----------------------+\n'
@@ -16118,7 +16680,9 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'Notes:\n'
'\n'
- '1. *t* must have the same length as the slice it is replacing.\n'
+ '1. If *k* is not equal to "1", *t* must have the same length as '
+ 'the\n'
+ ' slice it is replacing.\n'
'\n'
'2. The optional argument *i* defaults to "-1", so that by '
'default the\n'
@@ -16475,7 +17039,7 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
' * The linspace recipe shows how to implement a lazy version of '
'range\n'
- ' suitable for floating point applications.\n',
+ ' suitable for floating-point applications.\n',
'typesseq-mutable': 'Mutable Sequence Types\n'
'**********************\n'
'\n'
@@ -16568,8 +17132,8 @@ topics = {'assert': 'The "assert" statement\n'
'| | also removes it from '
'*s* | |\n'
'+--------------------------------+----------------------------------+-----------------------+\n'
- '| "s.remove(x)" | remove the first item '
- 'from *s* | (3) |\n'
+ '| "s.remove(x)" | removes the first '
+ 'item from *s* | (3) |\n'
'| | where "s[i]" is equal '
'to *x* | |\n'
'+--------------------------------+----------------------------------+-----------------------+\n'
@@ -16582,8 +17146,9 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'Notes:\n'
'\n'
- '1. *t* must have the same length as the slice it is '
- 'replacing.\n'
+ '1. If *k* is not equal to "1", *t* must have the same '
+ 'length as the\n'
+ ' slice it is replacing.\n'
'\n'
'2. The optional argument *i* defaults to "-1", so that '
'by default the\n'