summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorPablo Galindo <pablogsal@gmail.com>2024-02-06 21:20:31 (GMT)
committerPablo Galindo <pablogsal@gmail.com>2024-02-06 21:21:21 (GMT)
commitdb85d51d3ea4adfc6147d6af400e167659689eed (patch)
treebb5034035ed763a46af8401cd8268cbc201fe885 /Lib
parenta04dc431486f20b1c4f7f12a27ca2269329c41bf (diff)
downloadcpython-db85d51d3ea4adfc6147d6af400e167659689eed.zip
cpython-db85d51d3ea4adfc6147d6af400e167659689eed.tar.gz
cpython-db85d51d3ea4adfc6147d6af400e167659689eed.tar.bz2
Python 3.11.8v3.11.8
Diffstat (limited to 'Lib')
-rw-r--r--Lib/pydoc_data/topics.py956
1 files changed, 585 insertions, 371 deletions
diff --git a/Lib/pydoc_data/topics.py b/Lib/pydoc_data/topics.py
index 9cdf477..d43b5c6 100644
--- a/Lib/pydoc_data/topics.py
+++ b/Lib/pydoc_data/topics.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# Autogenerated by Sphinx on Mon Dec 4 17:55:07 2023
+# Autogenerated by Sphinx on Tue Feb 6 21:21:08 2024
# as part of the release process.
topics = {'assert': 'The "assert" statement\n'
'**********************\n'
@@ -934,19 +934,25 @@ topics = {'assert': 'The "assert" statement\n'
'*instance* of the\n'
' owner class.\n'
'\n'
- 'The attribute "__objclass__" is interpreted by the '
- '"inspect" module as\n'
- 'specifying the class where this object was defined '
+ 'Instances of descriptors may also have the '
+ '"__objclass__" attribute\n'
+ 'present:\n'
+ '\n'
+ 'object.__objclass__\n'
+ '\n'
+ ' The attribute "__objclass__" is interpreted by the '
+ '"inspect" module\n'
+ ' as specifying the class where this object was defined '
'(setting this\n'
- 'appropriately can assist in runtime introspection of '
+ ' appropriately can assist in runtime introspection of '
'dynamic class\n'
- 'attributes). For callables, it may indicate that an '
+ ' attributes). For callables, it may indicate that an '
'instance of the\n'
- 'given type (or a subclass) is expected or required as '
+ ' given type (or a subclass) is expected or required as '
'the first\n'
- 'positional argument (for example, CPython sets this '
+ ' positional argument (for example, CPython sets this '
'attribute for\n'
- 'unbound methods that are implemented in C).\n'
+ ' unbound methods that are implemented in C).\n'
'\n'
'\n'
'Invoking Descriptors\n'
@@ -3112,8 +3118,7 @@ topics = {'assert': 'The "assert" statement\n'
'standard\n'
'Python grammar. Triple-quoted strings are supported. Raw '
'strings and\n'
- 'byte strings are supported. Formatted string literals are not\n'
- 'supported.\n'
+ 'byte strings are supported. f-strings are not supported.\n'
'\n'
'The forms "signed_number \'+\' NUMBER" and "signed_number \'-\' '
'NUMBER"\n'
@@ -3754,7 +3759,7 @@ topics = {'assert': 'The "assert" statement\n'
' **PEP 526** - Syntax for Variable Annotations\n'
' Ability to type hint variable declarations, including '
'class\n'
- ' variables and instance variables\n'
+ ' variables and instance variables.\n'
'\n'
' **PEP 563** - Postponed Evaluation of Annotations\n'
' Support for forward references within annotations by '
@@ -3762,6 +3767,11 @@ topics = {'assert': 'The "assert" statement\n'
' annotations in a string form at runtime instead of eager\n'
' evaluation.\n'
'\n'
+ ' **PEP 318** - Decorators for Functions and Methods\n'
+ ' Function and method decorators were introduced. Class '
+ 'decorators\n'
+ ' were introduced in **PEP 3129**.\n'
+ '\n'
'\n'
'Class definitions\n'
'=================\n'
@@ -4599,8 +4609,8 @@ topics = {'assert': 'The "assert" statement\n'
'denial-of-service caused\n'
' by carefully chosen inputs that exploit the worst '
'case\n'
- ' performance of a dict insertion, O(n^2) complexity. '
- 'See\n'
+ ' performance of a dict insertion, *O*(*n*^2) '
+ 'complexity. See\n'
' http://ocert.org/advisories/ocert-2011-003.html for\n'
' details.Changing hash values affects the iteration '
'order of sets.\n'
@@ -4679,7 +4689,7 @@ topics = {'assert': 'The "assert" statement\n'
'and continue running without the debugger using the "continue"\n'
'command.\n'
'\n'
- 'New in version 3.7: The built-in "breakpoint()", when called '
+ 'Changed in version 3.7: The built-in "breakpoint()", when called '
'with\n'
'defaults, can be used instead of "import pdb; pdb.set_trace()".\n'
'\n'
@@ -4723,11 +4733,11 @@ topics = {'assert': 'The "assert" statement\n'
'the\n'
'debugger upon program’s exit.\n'
'\n'
- 'New in version 3.2: "-c" option is introduced to execute '
+ 'Changed in version 3.2: Added the "-c" option to execute '
'commands as\n'
- 'if given in a ".pdbrc" file, see Debugger Commands.\n'
+ 'if given in a ".pdbrc" file; see Debugger Commands.\n'
'\n'
- 'New in version 3.7: "-m" option is introduced to execute '
+ 'Changed in version 3.7: Added the "-m" option to execute '
'modules\n'
'similar to the way "python -m" does. As with a script, the '
'debugger\n'
@@ -4873,11 +4883,11 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
' Raises an auditing event "pdb.Pdb" with no arguments.\n'
'\n'
- ' New in version 3.1: The *skip* argument.\n'
+ ' Changed in version 3.1: Added the *skip* parameter.\n'
'\n'
- ' New in version 3.2: The *nosigint* argument. Previously, a '
- 'SIGINT\n'
- ' handler was never set by Pdb.\n'
+ ' Changed in version 3.2: Added the *nosigint* parameter. '
+ 'Previously,\n'
+ ' a SIGINT handler was never set by Pdb.\n'
'\n'
' Changed in version 3.6: The *readrc* argument.\n'
'\n'
@@ -5197,7 +5207,7 @@ topics = {'assert': 'The "assert" statement\n'
'differs\n'
' from the current line.\n'
'\n'
- ' New in version 3.2: The ">>" marker.\n'
+ ' Changed in version 3.2: Added the ">>" marker.\n'
'\n'
'll | longlist\n'
'\n'
@@ -5975,15 +5985,15 @@ topics = {'assert': 'The "assert" statement\n'
'originally\n'
'proposed by **PEP 448**.\n'
'\n'
- 'The trailing comma is required only to create a single tuple '
- '(a.k.a. a\n'
- '*singleton*); it is optional in all other cases. A single '
- 'expression\n'
- 'without a trailing comma doesn’t create a tuple, but rather '
- 'yields the\n'
- 'value of that expression. (To create an empty tuple, use an '
- 'empty pair\n'
- 'of parentheses: "()".)\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 '
+ 'without a\n'
+ 'trailing comma doesn’t create a tuple, but rather yields the '
+ 'value of\n'
+ 'that expression. (To create an empty tuple, use an empty pair '
+ 'of\n'
+ 'parentheses: "()".)\n',
'floating': 'Floating point literals\n'
'***********************\n'
'\n'
@@ -6097,7 +6107,7 @@ topics = {'assert': 'The "assert" statement\n'
' index_string ::= <any source character except "]"> '
'+\n'
' conversion ::= "r" | "s" | "a"\n'
- ' format_spec ::= <described in the next section>\n'
+ ' format_spec ::= format-spec:format_spec\n'
'\n'
'In less formal terms, the replacement field can start with '
'a\n'
@@ -6232,12 +6242,11 @@ topics = {'assert': 'The "assert" statement\n'
'contained\n'
'within a format string to define how individual values are '
'presented\n'
- '(see Format String Syntax and Formatted string literals). '
- 'They can\n'
- 'also be passed directly to the built-in "format()" '
- 'function. Each\n'
- 'formattable type may define how the format specification is '
- 'to be\n'
+ '(see Format String Syntax and f-strings). They can also be '
+ 'passed\n'
+ 'directly to the built-in "format()" function. Each '
+ 'formattable type\n'
+ 'may define how the format specification is to be '
'interpreted.\n'
'\n'
'Most built-in types implement the following options for '
@@ -7039,13 +7048,18 @@ topics = {'assert': 'The "assert" statement\n'
' **PEP 526** - Syntax for Variable Annotations\n'
' Ability to type hint variable declarations, including '
'class\n'
- ' variables and instance variables\n'
+ ' variables and instance variables.\n'
'\n'
' **PEP 563** - Postponed Evaluation of Annotations\n'
' Support for forward references within annotations by '
'preserving\n'
' annotations in a string form at runtime instead of eager\n'
- ' evaluation.\n',
+ ' evaluation.\n'
+ '\n'
+ ' **PEP 318** - Decorators for Functions and Methods\n'
+ ' Function and method decorators were introduced. Class '
+ 'decorators\n'
+ ' were introduced in **PEP 3129**.\n',
'global': 'The "global" statement\n'
'**********************\n'
'\n'
@@ -8594,15 +8608,13 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'A traceback object is normally created automatically when an '
'exception\n'
- 'is raised and attached to it as the "__traceback__" attribute, '
- 'which\n'
- 'is writable. You can create an exception and set your own traceback '
- 'in\n'
- 'one step using the "with_traceback()" exception method (which '
- 'returns\n'
- 'the same exception instance, with its traceback set to its '
- 'argument),\n'
- 'like so:\n'
+ 'is raised and attached to it as the "__traceback__" attribute. You '
+ 'can\n'
+ 'create an exception and set your own traceback in one step using '
+ 'the\n'
+ '"with_traceback()" exception method (which returns the same '
+ 'exception\n'
+ 'instance, with its traceback set to its argument), like so:\n'
'\n'
' raise Exception("foo occurred").with_traceback(tracebackobj)\n'
'\n'
@@ -8628,6 +8640,8 @@ topics = {'assert': 'The "assert" statement\n'
' ...\n'
' Traceback (most recent call last):\n'
' File "<stdin>", line 2, in <module>\n'
+ ' print(1 / 0)\n'
+ ' ~~^~~\n'
' ZeroDivisionError: division by zero\n'
'\n'
' The above exception was the direct cause of the following '
@@ -8635,6 +8649,7 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
' Traceback (most recent call last):\n'
' File "<stdin>", line 4, in <module>\n'
+ ' raise RuntimeError("Something bad happened") from exc\n'
' RuntimeError: Something bad happened\n'
'\n'
'A similar mechanism works implicitly if a new exception is raised '
@@ -8653,6 +8668,8 @@ topics = {'assert': 'The "assert" statement\n'
' ...\n'
' Traceback (most recent call last):\n'
' File "<stdin>", line 2, in <module>\n'
+ ' print(1 / 0)\n'
+ ' ~~^~~\n'
' ZeroDivisionError: division by zero\n'
'\n'
' During handling of the above exception, another exception '
@@ -8660,6 +8677,7 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
' Traceback (most recent call last):\n'
' File "<stdin>", line 4, in <module>\n'
+ ' raise RuntimeError("Something bad happened")\n'
' RuntimeError: Something bad happened\n'
'\n'
'Exception chaining can be explicitly suppressed by specifying '
@@ -8848,23 +8866,20 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
' Called to implement evaluation of "self[key]". For '
'*sequence*\n'
- ' types, the accepted keys should be integers and slice '
- 'objects.\n'
- ' Note that the special interpretation of negative '
- 'indexes (if the\n'
- ' class wishes to emulate a *sequence* type) is up to '
- 'the\n'
- ' "__getitem__()" method. If *key* is of an inappropriate '
- 'type,\n'
- ' "TypeError" may be raised; if of a value outside the '
- 'set of indexes\n'
- ' for the sequence (after any special interpretation of '
- 'negative\n'
- ' values), "IndexError" should be raised. For *mapping* '
- 'types, if\n'
- ' *key* is missing (not in the container), "KeyError" '
- 'should be\n'
- ' raised.\n'
+ ' types, the accepted keys should be integers. '
+ 'Optionally, they may\n'
+ ' support "slice" objects as well. Negative index '
+ 'support is also\n'
+ ' optional. If *key* is of an inappropriate type, '
+ '"TypeError" may be\n'
+ ' raised; if *key* is a value outside the set of indexes '
+ 'for the\n'
+ ' sequence (after any special interpretation of negative '
+ 'values),\n'
+ ' "IndexError" should be raised. For *mapping* types, if '
+ '*key* is\n'
+ ' missing (not in the container), "KeyError" should be '
+ 'raised.\n'
'\n'
' Note:\n'
'\n'
@@ -9578,8 +9593,8 @@ topics = {'assert': 'The "assert" statement\n'
' intended to provide protection against a '
'denial-of-service caused\n'
' by carefully chosen inputs that exploit the worst case\n'
- ' performance of a dict insertion, O(n^2) complexity. '
- 'See\n'
+ ' performance of a dict insertion, *O*(*n*^2) '
+ 'complexity. See\n'
' http://ocert.org/advisories/ocert-2011-003.html for\n'
' details.Changing hash values affects the iteration '
'order of sets.\n'
@@ -9857,19 +9872,25 @@ topics = {'assert': 'The "assert" statement\n'
'of the\n'
' owner class.\n'
'\n'
- 'The attribute "__objclass__" is interpreted by the "inspect" '
- 'module as\n'
- 'specifying the class where this object was defined (setting '
- 'this\n'
- 'appropriately can assist in runtime introspection of dynamic '
- 'class\n'
- 'attributes). For callables, it may indicate that an instance '
- 'of the\n'
- 'given type (or a subclass) is expected or required as the '
+ 'Instances of descriptors may also have the "__objclass__" '
+ 'attribute\n'
+ 'present:\n'
+ '\n'
+ 'object.__objclass__\n'
+ '\n'
+ ' The attribute "__objclass__" is interpreted by the '
+ '"inspect" module\n'
+ ' as specifying the class where this object was defined '
+ '(setting this\n'
+ ' appropriately can assist in runtime introspection of '
+ 'dynamic class\n'
+ ' attributes). For callables, it may indicate that an '
+ 'instance of the\n'
+ ' given type (or a subclass) is expected or required as the '
'first\n'
- 'positional argument (for example, CPython sets this '
+ ' positional argument (for example, CPython sets this '
'attribute for\n'
- 'unbound methods that are implemented in C).\n'
+ ' unbound methods that are implemented in C).\n'
'\n'
'\n'
'Invoking Descriptors\n'
@@ -10116,7 +10137,7 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
' Keyword arguments which are given to a new class are '
'passed to the\n'
- ' parent’s class "__init_subclass__". For compatibility '
+ ' parent class’s "__init_subclass__". For compatibility '
'with other\n'
' classes using "__init_subclass__", one should take out '
'the needed\n'
@@ -10798,22 +10819,20 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
' Called to implement evaluation of "self[key]". For '
'*sequence*\n'
- ' types, the accepted keys should be integers and slice '
- 'objects.\n'
- ' Note that the special interpretation of negative indexes '
- '(if the\n'
- ' class wishes to emulate a *sequence* type) is up to the\n'
- ' "__getitem__()" method. If *key* is of an inappropriate '
- 'type,\n'
- ' "TypeError" may be raised; if of a value outside the set '
- 'of indexes\n'
- ' for the sequence (after any special interpretation of '
- 'negative\n'
- ' values), "IndexError" should be raised. For *mapping* '
- 'types, if\n'
- ' *key* is missing (not in the container), "KeyError" '
- 'should be\n'
- ' raised.\n'
+ ' types, the accepted keys should be integers. Optionally, '
+ 'they may\n'
+ ' support "slice" objects as well. Negative index support '
+ 'is also\n'
+ ' optional. If *key* is of an inappropriate type, '
+ '"TypeError" may be\n'
+ ' raised; if *key* is a value outside the set of indexes '
+ 'for the\n'
+ ' sequence (after any special interpretation of negative '
+ 'values),\n'
+ ' "IndexError" should be raised. For *mapping* types, if '
+ '*key* is\n'
+ ' missing (not in the container), "KeyError" should be '
+ 'raised.\n'
'\n'
' Note:\n'
'\n'
@@ -11913,7 +11932,7 @@ topics = {'assert': 'The "assert" statement\n'
'followed by\n'
' the string itself.\n'
'\n'
- 'str.rsplit(sep=None, maxsplit=- 1)\n'
+ 'str.rsplit(sep=None, maxsplit=-1)\n'
'\n'
' Return a list of the words in the string, using *sep* '
'as the\n'
@@ -11954,7 +11973,7 @@ topics = {'assert': 'The "assert" statement\n'
" >>> 'Monty Python'.removesuffix(' Python')\n"
" 'Monty'\n"
'\n'
- 'str.split(sep=None, maxsplit=- 1)\n'
+ 'str.split(sep=None, maxsplit=-1)\n'
'\n'
' Return a list of the words in the string, using *sep* '
'as the\n'
@@ -12347,12 +12366,11 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'A string literal with "\'f\'" or "\'F\'" in its prefix is a '
'*formatted\n'
- 'string literal*; see Formatted string literals. The "\'f\'" may '
- 'be\n'
- 'combined with "\'r\'", but not with "\'b\'" or "\'u\'", therefore '
- 'raw\n'
- 'formatted strings are possible, but formatted bytes literals are '
- 'not.\n'
+ 'string literal*; see f-strings. The "\'f\'" may be combined with '
+ '"\'r\'",\n'
+ 'but not with "\'b\'" or "\'u\'", therefore raw formatted strings '
+ 'are\n'
+ 'possible, but formatted bytes literals are not.\n'
'\n'
'In triple-quoted literals, unescaped newlines and quotes are '
'allowed\n'
@@ -12361,6 +12379,10 @@ topics = {'assert': 'The "assert" statement\n'
'the\n'
'literal, i.e. either "\'" or """.)\n'
'\n'
+ '\n'
+ 'Escape sequences\n'
+ '================\n'
+ '\n'
'Unless an "\'r\'" or "\'R\'" prefix is present, escape sequences '
'in string\n'
'and bytes literals are interpreted according to rules similar to '
@@ -13250,123 +13272,112 @@ topics = {'assert': 'The "assert" statement\n'
'function’s\n'
'formal parameter list.\n'
'\n'
- 'Special attributes:\n'
'\n'
- '+---------------------------+---------------------------------+-------------+\n'
- '| Attribute | Meaning '
- '| |\n'
- '|===========================|=================================|=============|\n'
- '| "__doc__" | The function’s documentation | '
- 'Writable |\n'
- '| | string, or "None" if '
- '| |\n'
- '| | unavailable; not inherited by '
- '| |\n'
- '| | subclasses. '
- '| |\n'
- '+---------------------------+---------------------------------+-------------+\n'
- '| "__name__" | The function’s name. | '
- 'Writable |\n'
- '+---------------------------+---------------------------------+-------------+\n'
- '| "__qualname__" | The function’s *qualified | '
- 'Writable |\n'
- '| | name*. New in version 3.3. '
- '| |\n'
- '+---------------------------+---------------------------------+-------------+\n'
- '| "__module__" | The name of the module the | '
- 'Writable |\n'
- '| | function was defined in, or '
- '| |\n'
- '| | "None" if unavailable. '
- '| |\n'
- '+---------------------------+---------------------------------+-------------+\n'
- '| "__defaults__" | A tuple containing default | '
- 'Writable |\n'
- '| | argument values for those '
- '| |\n'
- '| | arguments that have defaults, '
- '| |\n'
- '| | or "None" if no arguments have '
- '| |\n'
- '| | a default value. '
- '| |\n'
- '+---------------------------+---------------------------------+-------------+\n'
- '| "__code__" | The code object representing | '
- 'Writable |\n'
- '| | the compiled function body. '
- '| |\n'
- '+---------------------------+---------------------------------+-------------+\n'
- '| "__globals__" | A reference to the dictionary | '
- 'Read-only |\n'
- '| | that holds the function’s '
- '| |\n'
- '| | global variables — the global '
- '| |\n'
- '| | namespace of the module in '
- '| |\n'
- '| | which the function was defined. '
- '| |\n'
- '+---------------------------+---------------------------------+-------------+\n'
- '| "__dict__" | The namespace supporting | '
- 'Writable |\n'
- '| | arbitrary function attributes. '
- '| |\n'
- '+---------------------------+---------------------------------+-------------+\n'
- '| "__closure__" | "None" or a tuple of cells that | '
- 'Read-only |\n'
- '| | contain bindings for the '
- '| |\n'
- '| | function’s free variables. See '
- '| |\n'
- '| | below for information on the '
- '| |\n'
- '| | "cell_contents" attribute. '
- '| |\n'
- '+---------------------------+---------------------------------+-------------+\n'
- '| "__annotations__" | A dict containing annotations | '
- 'Writable |\n'
- '| | of parameters. The keys of the '
- '| |\n'
- '| | dict are the parameter names, '
- '| |\n'
- '| | and "\'return\'" for the return '
- '| |\n'
- '| | annotation, if provided. For '
- '| |\n'
- '| | more information on working '
- '| |\n'
- '| | with this attribute, see '
- '| |\n'
- '| | Annotations Best Practices. '
- '| |\n'
- '+---------------------------+---------------------------------+-------------+\n'
- '| "__kwdefaults__" | A dict containing defaults for | '
- 'Writable |\n'
- '| | keyword-only parameters. '
- '| |\n'
- '+---------------------------+---------------------------------+-------------+\n'
- '\n'
- 'Most of the attributes labelled “Writable” check the type of the\n'
- 'assigned value.\n'
+ 'Special read-only attributes\n'
+ '~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n'
+ '\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| Attribute | '
+ 'Meaning |\n'
+ '|====================================================|====================================================|\n'
+ '| function.__globals__ | A reference '
+ 'to the "dictionary" that holds the |\n'
+ '| | function’s '
+ 'global variables – the global namespace |\n'
+ '| | of the '
+ 'module in which the function was defined. |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\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'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '\n'
+ '\n'
+ 'Special writable attributes\n'
+ '~~~~~~~~~~~~~~~~~~~~~~~~~~~\n'
+ '\n'
+ 'Most of these attributes check the type of the assigned value:\n'
+ '\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| Attribute | '
+ 'Meaning |\n'
+ '|====================================================|====================================================|\n'
+ '| function.__doc__ | The '
+ 'function’s documentation string, or "None" if |\n'
+ '| | unavailable. '
+ 'Not inherited by subclasses. |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| function.__name__ | The '
+ 'function’s name. See also: "__name__ |\n'
+ '| | '
+ 'attributes". |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| function.__qualname__ | The '
+ 'function’s *qualified name*. See also: |\n'
+ '| | '
+ '"__qualname__ attributes". New in version 3.3. |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| function.__module__ | The name of '
+ 'the module the function was defined |\n'
+ '| | in, or '
+ '"None" if unavailable. |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| function.__defaults__ | A "tuple" '
+ 'containing default *parameter* values |\n'
+ '| | for those '
+ 'parameters that have defaults, or "None" |\n'
+ '| | if no '
+ 'parameters have a default value. |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| function.__code__ | The code '
+ 'object representing the compiled function |\n'
+ '| | '
+ 'body. |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| function.__dict__ | The '
+ 'namespace supporting arbitrary function |\n'
+ '| | attributes. '
+ 'See also: "__dict__ attributes". |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| function.__annotations__ | A '
+ '"dictionary" containing annotations of |\n'
+ '| | '
+ '*parameters*. The keys of the dictionary are the |\n'
+ '| | parameter '
+ 'names, and "\'return\'" for the return |\n'
+ '| | annotation, '
+ 'if provided. See also: Annotations |\n'
+ '| | Best '
+ 'Practices. |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| function.__kwdefaults__ | A '
+ '"dictionary" containing defaults for keyword- |\n'
+ '| | only '
+ '*parameters*. |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
'\n'
'Function objects also support getting and setting arbitrary\n'
'attributes, which can be used, for example, to attach metadata to\n'
'functions. Regular attribute dot-notation is used to get and set '
'such\n'
- 'attributes. *Note that the current implementation only supports\n'
- 'function attributes on user-defined functions. Function attributes '
- 'on\n'
- 'built-in functions may be supported in the future.*\n'
+ 'attributes.\n'
'\n'
- 'A cell object has the attribute "cell_contents". This can be used '
- 'to\n'
- 'get the value of the cell, as well as set the value.\n'
+ '**CPython implementation detail:** CPython’s current '
+ 'implementation\n'
+ 'only supports function attributes on user-defined functions. '
+ 'Function\n'
+ 'attributes on built-in functions may be supported in the future.\n'
'\n'
'Additional information about a function’s definition can be '
'retrieved\n'
- 'from its code object; see the description of internal types below. '
- 'The\n'
- '"cell" type can be accessed in the "types" module.\n'
+ 'from its code object (accessible via the "__code__" attribute).\n'
'\n'
'\n'
'Instance methods\n'
@@ -13376,14 +13387,34 @@ topics = {'assert': 'The "assert" statement\n'
'any\n'
'callable object (normally a user-defined function).\n'
'\n'
- 'Special read-only attributes: "__self__" is the class instance '
- 'object,\n'
- '"__func__" is the function object; "__doc__" is the method’s\n'
- 'documentation (same as "__func__.__doc__"); "__name__" is the '
- 'method\n'
- 'name (same as "__func__.__name__"); "__module__" is the name of '
- 'the\n'
- 'module the method was defined in, or "None" if unavailable.\n'
+ 'Special read-only attributes:\n'
+ '\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| method.__self__ | Refers to '
+ 'the class instance object to which the |\n'
+ '| | method is '
+ 'bound |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| method.__func__ | Refers to '
+ 'the original function object |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| method.__doc__ | The method’s '
+ 'documentation (same as |\n'
+ '| | '
+ '"method.__func__.__doc__"). A "string" if the |\n'
+ '| | original '
+ 'function had a docstring, else "None". |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| method.__name__ | The name of '
+ 'the method (same as |\n'
+ '| | '
+ '"method.__func__.__name__") |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| method.__module__ | The name of '
+ 'the module the method was defined in, |\n'
+ '| | or "None" if '
+ 'unavailable. |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
'\n'
'Methods also support accessing (but not setting) the arbitrary\n'
'function attributes on the underlying function object.\n'
@@ -13392,24 +13423,20 @@ topics = {'assert': 'The "assert" statement\n'
'attribute\n'
'of a class (perhaps via an instance of that class), if that '
'attribute\n'
- 'is a user-defined function object or a class method object.\n'
+ 'is a user-defined function object or a "classmethod" object.\n'
'\n'
'When an instance method object is created by retrieving a '
'user-defined\n'
'function object from a class via one of its instances, its '
'"__self__"\n'
- 'attribute is the instance, and the method object is said to be '
- 'bound.\n'
- 'The new method’s "__func__" attribute is the original function '
- 'object.\n'
+ 'attribute is the instance, and the method object is said to be\n'
+ '*bound*. The new method’s "__func__" attribute is the original\n'
+ 'function object.\n'
'\n'
- 'When an instance method object is created by retrieving a class '
- 'method\n'
- 'object from a class or instance, its "__self__" attribute is the '
- 'class\n'
- 'itself, and its "__func__" attribute is the function object '
- 'underlying\n'
- 'the class method.\n'
+ 'When an instance method object is created by retrieving a\n'
+ '"classmethod" object from a class or instance, its "__self__"\n'
+ 'attribute is the class itself, and its "__func__" attribute is the\n'
+ 'function object underlying the class method.\n'
'\n'
'When an instance method object is called, the underlying function\n'
'("__func__") is called, inserting the class instance ("__self__") '
@@ -13420,7 +13447,7 @@ topics = {'assert': 'The "assert" statement\n'
'of\n'
'"C", calling "x.f(1)" is equivalent to calling "C.f(x, 1)".\n'
'\n'
- 'When an instance method object is derived from a class method '
+ 'When an instance method object is derived from a "classmethod" '
'object,\n'
'the “class instance” stored in "__self__" will actually be the '
'class\n'
@@ -13508,13 +13535,18 @@ topics = {'assert': 'The "assert" statement\n'
'of built-in functions are "len()" and "math.sin()" ("math" is a\n'
'standard built-in module). The number and type of the arguments '
'are\n'
- 'determined by the C function. Special read-only attributes: '
- '"__doc__"\n'
- 'is the function’s documentation string, or "None" if unavailable;\n'
- '"__name__" is the function’s name; "__self__" is set to "None" '
- '(but\n'
- 'see the next item); "__module__" is the name of the module the\n'
- 'function was defined in or "None" if unavailable.\n'
+ 'determined by the C function. Special read-only attributes:\n'
+ '\n'
+ '* "__doc__" is the function’s documentation string, or "None" if\n'
+ ' unavailable. See "function.__doc__".\n'
+ '\n'
+ '* "__name__" is the function’s name. See "function.__name__".\n'
+ '\n'
+ '* "__self__" is set to "None" (but see the next item).\n'
+ '\n'
+ '* "__module__" is the name of the module the function was defined '
+ 'in\n'
+ ' or "None" if unavailable. See "function.__module__".\n'
'\n'
'\n'
'Built-in methods\n'
@@ -13526,7 +13558,9 @@ topics = {'assert': 'The "assert" statement\n'
'argument. An example of a built-in method is "alist.append()",\n'
'assuming *alist* is a list object. In this case, the special '
'read-only\n'
- 'attribute "__self__" is set to the object denoted by *alist*.\n'
+ 'attribute "__self__" is set to the object denoted by *alist*. (The\n'
+ 'attribute has the same semantics as it does with "other instance\n'
+ 'methods".)\n'
'\n'
'\n'
'Classes\n'
@@ -13558,16 +13592,15 @@ topics = {'assert': 'The "assert" statement\n'
'statement, or by calling functions such as '
'"importlib.import_module()"\n'
'and built-in "__import__()". A module object has a namespace\n'
- 'implemented by a dictionary object (this is the dictionary '
- 'referenced\n'
- 'by the "__globals__" attribute of functions defined in the '
- 'module).\n'
- 'Attribute references are translated to lookups in this dictionary,\n'
- 'e.g., "m.x" is equivalent to "m.__dict__["x"]". A module object '
- 'does\n'
- 'not contain the code object used to initialize the module (since '
- 'it\n'
- 'isn’t needed once the initialization is done).\n'
+ 'implemented by a "dictionary" object (this is the dictionary\n'
+ 'referenced by the "__globals__" attribute of functions defined in '
+ 'the\n'
+ 'module). Attribute references are translated to lookups in this\n'
+ 'dictionary, e.g., "m.x" is equivalent to "m.__dict__["x"]". A '
+ 'module\n'
+ 'object does not contain the code object used to initialize the '
+ 'module\n'
+ '(since it isn’t needed once the initialization is done).\n'
'\n'
'Attribute assignment updates the module’s namespace dictionary, '
'e.g.,\n'
@@ -13641,14 +13674,13 @@ topics = {'assert': 'The "assert" statement\n'
'a\n'
'class method object, it is transformed into an instance method '
'object\n'
- 'whose "__self__" attribute is "C". When it would yield a static\n'
- 'method object, it is transformed into the object wrapped by the '
- 'static\n'
- 'method object. See section Implementing Descriptors for another way '
- 'in\n'
- 'which attributes retrieved from a class may differ from those '
- 'actually\n'
- 'contained in its "__dict__".\n'
+ 'whose "__self__" attribute is "C". When it would yield a\n'
+ '"staticmethod" object, it is transformed into the object wrapped '
+ 'by\n'
+ 'the static method object. See section Implementing Descriptors for\n'
+ 'another way in which attributes retrieved from a class may differ '
+ 'from\n'
+ 'those actually contained in its "__dict__".\n'
'\n'
'Class attribute assignments update the class’s dictionary, never '
'the\n'
@@ -13768,40 +13800,102 @@ topics = {'assert': 'The "assert" statement\n'
'code objects are immutable and contain no references (directly or\n'
'indirectly) to mutable objects.\n'
'\n'
- 'Special read-only attributes: "co_name" gives the function name;\n'
- '"co_qualname" gives the fully qualified function name; '
- '"co_argcount"\n'
- 'is the total number of positional arguments (including '
- 'positional-only\n'
- 'arguments and arguments with default values); "co_posonlyargcount" '
- 'is\n'
- 'the number of positional-only arguments (including arguments with\n'
- 'default values); "co_kwonlyargcount" is the number of keyword-only\n'
- 'arguments (including arguments with default values); "co_nlocals" '
- 'is\n'
- 'the number of local variables used by the function (including\n'
- 'arguments); "co_varnames" is a tuple containing the names of the '
- 'local\n'
- 'variables (starting with the argument names); "co_cellvars" is a '
- 'tuple\n'
- 'containing the names of local variables that are referenced by '
- 'nested\n'
- 'functions; "co_freevars" is a tuple containing the names of free\n'
- 'variables; "co_code" is a string representing the sequence of '
- 'bytecode\n'
- 'instructions; "co_consts" is a tuple containing the literals used '
- 'by\n'
- 'the bytecode; "co_names" is a tuple containing the names used by '
- 'the\n'
- 'bytecode; "co_filename" is the filename from which the code was\n'
- 'compiled; "co_firstlineno" is the first line number of the '
- 'function;\n'
- '"co_lnotab" is a string encoding the mapping from bytecode offsets '
- 'to\n'
- 'line numbers (for details see the source code of the interpreter);\n'
- '"co_stacksize" is the required stack size; "co_flags" is an '
- 'integer\n'
- 'encoding a number of flags for the interpreter.\n'
+ '\n'
+ 'Special read-only attributes\n'
+ '~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n'
+ '\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| codeobject.co_name | The function '
+ 'name |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| codeobject.co_qualname | The fully '
+ 'qualified function name |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| codeobject.co_argcount | The total '
+ 'number of positional *parameters* |\n'
+ '| | (including '
+ 'positional-only parameters and |\n'
+ '| | parameters '
+ 'with default values) that the function |\n'
+ '| | '
+ 'has |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| codeobject.co_posonlyargcount | The number '
+ 'of positional-only *parameters* |\n'
+ '| | (including '
+ 'arguments with default values) that the |\n'
+ '| | function '
+ 'has |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| codeobject.co_kwonlyargcount | The number '
+ 'of keyword-only *parameters* (including |\n'
+ '| | arguments '
+ 'with default values) that the function |\n'
+ '| | '
+ 'has |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| codeobject.co_nlocals | The number '
+ 'of local variables used by the function |\n'
+ '| | (including '
+ 'parameters) |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| codeobject.co_varnames | A "tuple" '
+ 'containing the names of the local |\n'
+ '| | variables in '
+ 'the function (starting with the |\n'
+ '| | parameter '
+ 'names) |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| codeobject.co_cellvars | A "tuple" '
+ 'containing the names of local variables |\n'
+ '| | that are '
+ 'referenced by nested functions inside the |\n'
+ '| | '
+ 'function |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| codeobject.co_freevars | A "tuple" '
+ 'containing the names of free variables |\n'
+ '| | in the '
+ 'function |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| codeobject.co_code | A string '
+ 'representing the sequence of *bytecode* |\n'
+ '| | instructions '
+ 'in the function |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| codeobject.co_consts | A "tuple" '
+ 'containing the literals used by the |\n'
+ '| | *bytecode* '
+ 'in the function |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| codeobject.co_names | A "tuple" '
+ 'containing the names used by the |\n'
+ '| | *bytecode* '
+ 'in the function |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| codeobject.co_filename | The name of '
+ 'the file from which the code was |\n'
+ '| | '
+ 'compiled |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| codeobject.co_firstlineno | The line '
+ 'number of the first line of the function |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| codeobject.co_lnotab | A string '
+ 'encoding the mapping from *bytecode* |\n'
+ '| | offsets to '
+ 'line numbers. For details, see the |\n'
+ '| | source code '
+ 'of the interpreter. |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| codeobject.co_stacksize | The required '
+ 'stack size of the code object |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| codeobject.co_flags | An "integer" '
+ 'encoding a number of flags for the |\n'
+ '| | '
+ 'interpreter. |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
'\n'
'The following flag bits are defined for "co_flags": bit "0x04" is '
'set\n'
@@ -13810,7 +13904,9 @@ topics = {'assert': 'The "assert" statement\n'
'number of positional arguments; bit "0x08" is set if the function '
'uses\n'
'the "**keywords" syntax to accept arbitrary keyword arguments; bit\n'
- '"0x20" is set if the function is a generator.\n'
+ '"0x20" is set if the function is a generator. See Code Objects Bit\n'
+ 'Flags for details on the semantics of each flags that might be\n'
+ 'present.\n'
'\n'
'Future feature declarations ("from __future__ import division") '
'also\n'
@@ -13829,16 +13925,19 @@ topics = {'assert': 'The "assert" statement\n'
'is the documentation string of the function, or "None" if '
'undefined.\n'
'\n'
+ '\n'
+ 'Methods on code objects\n'
+ '~~~~~~~~~~~~~~~~~~~~~~~\n'
+ '\n'
'codeobject.co_positions()\n'
'\n'
- ' Returns an iterable over the source code positions of each '
- 'bytecode\n'
- ' instruction in the code object.\n'
+ ' Returns an iterable over the source code positions of each\n'
+ ' *bytecode* instruction in the code object.\n'
'\n'
- ' The iterator returns tuples containing the "(start_line, '
- 'end_line,\n'
- ' start_column, end_column)". The *i-th* tuple corresponds to the\n'
- ' position of the source code that compiled to the *i-th*\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'
@@ -13876,51 +13975,153 @@ topics = {'assert': 'The "assert" statement\n'
'the\n'
' "PYTHONNODEBUGRANGES" environment variable can be used.\n'
'\n'
+ 'codeobject.co_lines()\n'
'\n'
- 'Frame objects\n'
- '-------------\n'
+ ' Returns an iterator that yields information about successive '
+ 'ranges\n'
+ ' of *bytecode*s. Each item yielded is a "(start, end, lineno)"\n'
+ ' "tuple":\n'
'\n'
- 'Frame objects represent execution frames. They may occur in '
- 'traceback\n'
- 'objects (see below), and are also passed to registered trace\n'
- 'functions.\n'
+ ' * "start" (an "int") represents the offset (inclusive) of the '
+ 'start\n'
+ ' of the *bytecode* range\n'
'\n'
- 'Special read-only attributes: "f_back" is to the previous stack '
- 'frame\n'
- '(towards the caller), or "None" if this is the bottom stack frame;\n'
- '"f_code" is the code object being executed in this frame; '
- '"f_locals"\n'
- 'is the dictionary used to look up local variables; "f_globals" is '
- 'used\n'
- 'for global variables; "f_builtins" is used for built-in '
- '(intrinsic)\n'
- 'names; "f_lasti" gives the precise instruction (this is an index '
- 'into\n'
- 'the bytecode string of the code object).\n'
+ ' * "end" (an "int") represents the offset (exclusive) of the end '
+ 'of\n'
+ ' the *bytecode* range\n'
'\n'
- 'Accessing "f_code" raises an auditing event "object.__getattr__" '
- 'with\n'
- 'arguments "obj" and ""f_code"".\n'
+ ' * "lineno" is an "int" representing the line number of the\n'
+ ' *bytecode* range, or "None" if the bytecodes in the given '
+ 'range\n'
+ ' have no line number\n'
'\n'
- 'Special writable attributes: "f_trace", if not "None", is a '
- 'function\n'
- 'called for various events during code execution (this is used by '
+ ' The items yielded will have the following properties:\n'
+ '\n'
+ ' * The first range yielded will have a "start" of 0.\n'
+ '\n'
+ ' * The "(start, end)" ranges will be non-decreasing and '
+ 'consecutive.\n'
+ ' That is, for any pair of "tuple"s, the "start" of the second '
+ 'will\n'
+ ' be equal to the "end" of the first.\n'
+ '\n'
+ ' * No range will be backwards: "end >= start" for all triples.\n'
+ '\n'
+ ' * The last "tuple" yielded will have "end" equal to the size of '
'the\n'
- 'debugger). Normally an event is triggered for each new source line '
- '-\n'
- 'this can be disabled by setting "f_trace_lines" to "False".\n'
- '\n'
- 'Implementations *may* allow per-opcode events to be requested by\n'
- 'setting "f_trace_opcodes" to "True". Note that this may lead to\n'
- 'undefined interpreter behaviour if exceptions raised by the trace\n'
- 'function escape to the function being traced.\n'
- '\n'
- '"f_lineno" is the current line number of the frame — writing to '
- 'this\n'
- 'from within a trace function jumps to the given line (only for the\n'
- 'bottom-most frame). A debugger can implement a Jump command (aka '
- 'Set\n'
- 'Next Statement) by writing to f_lineno.\n'
+ ' *bytecode*.\n'
+ '\n'
+ ' Zero-width ranges, where "start == end", are allowed. '
+ 'Zero-width\n'
+ ' ranges are used for lines that are present in the source code, '
+ 'but\n'
+ ' have been eliminated by the *bytecode* compiler.\n'
+ '\n'
+ ' New in version 3.10.\n'
+ '\n'
+ ' See also:\n'
+ '\n'
+ ' **PEP 626** - Precise line numbers for debugging and other '
+ 'tools.\n'
+ ' The PEP that introduced the "co_lines()" method.\n'
+ '\n'
+ '\n'
+ 'Frame objects\n'
+ '-------------\n'
+ '\n'
+ 'Frame objects represent execution frames. They may occur in '
+ 'traceback\n'
+ 'objects, and are also passed to registered trace functions.\n'
+ '\n'
+ '\n'
+ 'Special read-only attributes\n'
+ '~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n'
+ '\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| frame.f_back | Points to '
+ 'the previous stack frame (towards the |\n'
+ '| | caller), or '
+ '"None" if this is the bottom stack |\n'
+ '| | '
+ 'frame |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| frame.f_code | The code '
+ 'object being executed in this frame. |\n'
+ '| | Accessing '
+ 'this attribute raises an auditing event |\n'
+ '| | '
+ '"object.__getattr__" with arguments "obj" and |\n'
+ '| | '
+ '""f_code"". |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| frame.f_locals | The '
+ 'dictionary used by the frame to look up local |\n'
+ '| | '
+ 'variables |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| frame.f_globals | The '
+ 'dictionary used by the frame to look up global |\n'
+ '| | '
+ 'variables |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| frame.f_builtins | The '
+ 'dictionary used by the frame to look up built- |\n'
+ '| | in '
+ '(intrinsic) names |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| frame.f_lasti | The “precise '
+ 'instruction” of the frame object |\n'
+ '| | (this is an '
+ 'index into the *bytecode* string of |\n'
+ '| | the code '
+ 'object) |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '\n'
+ '\n'
+ 'Special writable attributes\n'
+ '~~~~~~~~~~~~~~~~~~~~~~~~~~~\n'
+ '\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| frame.f_trace | If not '
+ '"None", this is a function called for |\n'
+ '| | various '
+ 'events during code execution (this is used |\n'
+ '| | by '
+ 'debuggers). Normally an event is triggered for |\n'
+ '| | each new '
+ 'source line (see "f_trace_lines"). |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| frame.f_trace_lines | Set this '
+ 'attribute to "False" to disable |\n'
+ '| | triggering a '
+ 'tracing event for each source line. |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| frame.f_trace_opcodes | Set this '
+ 'attribute to "True" to allow per-opcode |\n'
+ '| | events to be '
+ 'requested. Note that this may lead to |\n'
+ '| | undefined '
+ 'interpreter behaviour if exceptions |\n'
+ '| | raised by '
+ 'the trace function escape to the |\n'
+ '| | function '
+ 'being traced. |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| frame.f_lineno | The current '
+ 'line number of the frame – writing to |\n'
+ '| | this from '
+ 'within a trace function jumps to the |\n'
+ '| | given line '
+ '(only for the bottom-most frame). A |\n'
+ '| | debugger can '
+ 'implement a Jump command (aka Set |\n'
+ '| | Next '
+ 'Statement) by writing to this attribute. |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '\n'
+ '\n'
+ 'Frame object methods\n'
+ '~~~~~~~~~~~~~~~~~~~~\n'
'\n'
'Frame objects support one method:\n'
'\n'
@@ -13928,7 +14129,7 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
' This method clears all references to local variables held by '
'the\n'
- ' frame. Also, if the frame belonged to a generator, the '
+ ' frame. Also, if the frame belonged to a *generator*, the '
'generator\n'
' is finalized. This helps break reference cycles involving '
'frame\n'
@@ -13943,11 +14144,14 @@ topics = {'assert': 'The "assert" statement\n'
'Traceback objects\n'
'-----------------\n'
'\n'
- 'Traceback objects represent a stack trace of an exception. A\n'
+ 'Traceback objects represent the stack trace of an exception. A\n'
'traceback object is implicitly created when an exception occurs, '
'and\n'
'may also be explicitly created by calling "types.TracebackType".\n'
'\n'
+ 'Changed in version 3.7: Traceback objects can now be explicitly\n'
+ 'instantiated from Python code.\n'
+ '\n'
'For implicitly created tracebacks, when the search for an '
'exception\n'
'handler unwinds the execution stack, at each unwound level a '
@@ -13970,30 +14174,40 @@ topics = {'assert': 'The "assert" statement\n'
'linked\n'
'to form a full stack trace.\n'
'\n'
- 'Special read-only attributes: "tb_frame" points to the execution '
- 'frame\n'
- 'of the current level; "tb_lineno" gives the line number where the\n'
- 'exception occurred; "tb_lasti" indicates the precise instruction. '
- 'The\n'
- 'line number and last instruction in the traceback may differ from '
+ 'Special read-only attributes:\n'
+ '\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| traceback.tb_frame | Points to '
+ 'the execution frame of the current |\n'
+ '| | level. '
+ 'Accessing this attribute raises an |\n'
+ '| | auditing '
+ 'event "object.__getattr__" with arguments |\n'
+ '| | "obj" and '
+ '""tb_frame"". |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| traceback.tb_lineno | Gives the '
+ 'line number where the exception occurred |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '| traceback.tb_lasti | Indicates '
+ 'the “precise instruction”. |\n'
+ '+----------------------------------------------------+----------------------------------------------------+\n'
+ '\n'
+ 'The line number and last instruction in the traceback may differ '
+ 'from\n'
+ 'the line number of its frame object if the exception occurred in a\n'
+ '"try" statement with no matching except clause or with a "finally"\n'
+ 'clause.\n'
+ '\n'
+ 'traceback.tb_next\n'
+ '\n'
+ ' The special writable attribute "tb_next" is the next level in '
'the\n'
- 'line number of its frame object if the exception occurred in a '
- '"try"\n'
- 'statement with no matching except clause or with a finally clause.\n'
- '\n'
- 'Accessing "tb_frame" raises an auditing event "object.__getattr__"\n'
- 'with arguments "obj" and ""tb_frame"".\n'
- '\n'
- 'Special writable attribute: "tb_next" is the next level in the '
- 'stack\n'
- 'trace (towards the frame where the exception occurred), or "None" '
- 'if\n'
- 'there is no next level.\n'
+ ' stack trace (towards the frame where the exception occurred), '
+ 'or\n'
+ ' "None" if there is no next level.\n'
'\n'
- 'Changed in version 3.7: Traceback objects can now be explicitly\n'
- 'instantiated from Python code, and the "tb_next" attribute of '
- 'existing\n'
- 'instances can be updated.\n'
+ ' Changed in version 3.7: This attribute is now writable\n'
'\n'
'\n'
'Slice objects\n'
@@ -14050,8 +14264,8 @@ topics = {'assert': 'The "assert" statement\n'
'around another object that alters the way in which that object is\n'
'retrieved from classes and class instances. The behaviour of class\n'
'method objects upon such retrieval is described above, under '
- '“User-\n'
- 'defined methods”. Class method objects are created by the built-in\n'
+ '“instance\n'
+ 'methods”. Class method objects are created by the built-in\n'
'"classmethod()" constructor.\n',
'typesfunctions': 'Functions\n'
'*********\n'
@@ -14562,7 +14776,7 @@ topics = {'assert': 'The "assert" statement\n'
'notation.\n'
'There are two flavors: built-in methods (such as "append()" '
'on lists)\n'
- 'and class instance methods. Built-in methods are described '
+ 'and class instance method. Built-in methods are described '
'with the\n'
'types that support them.\n'
'\n'
@@ -14570,8 +14784,8 @@ topics = {'assert': 'The "assert" statement\n'
'namespace)\n'
'through an instance, you get a special object: a *bound '
'method* (also\n'
- 'called *instance method*) object. When called, it will add '
- 'the "self"\n'
+ 'called instance method) object. When called, it will add the '
+ '"self"\n'
'argument to the argument list. Bound methods have two '
'special read-\n'
'only attributes: "m.__self__" is the object on which the '
@@ -14586,7 +14800,7 @@ topics = {'assert': 'The "assert" statement\n'
'arbitrary\n'
'attributes. However, since method attributes are actually '
'stored on\n'
- 'the underlying function object ("meth.__func__"), setting '
+ 'the underlying function object ("method.__func__"), setting '
'method\n'
'attributes on bound methods is disallowed. Attempting to '
'set an\n'
@@ -14611,7 +14825,7 @@ topics = {'assert': 'The "assert" statement\n'
' >>> c.method.whoami\n'
" 'my name is method'\n"
'\n'
- 'See The standard type hierarchy for more information.\n',
+ 'See Instance methods for more information.\n',
'typesmodules': 'Modules\n'
'*******\n'
'\n'