summaryrefslogtreecommitdiffstats
path: root/Lib/pydoc_data
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2024-01-17 12:09:05 (GMT)
committerThomas Wouters <thomas@python.org>2024-01-17 12:14:40 (GMT)
commitf009305a7d635f86440c804a2916f8fa4d7fc637 (patch)
tree504b13d711808015a89abd1e808f7da54f280708 /Lib/pydoc_data
parentb204c4beb44c1a9013f8da16984c9129374ed8c5 (diff)
downloadcpython-f009305a7d635f86440c804a2916f8fa4d7fc637.zip
cpython-f009305a7d635f86440c804a2916f8fa4d7fc637.tar.gz
cpython-f009305a7d635f86440c804a2916f8fa4d7fc637.tar.bz2
Python 3.13.0a3v3.13.0a3
Diffstat (limited to 'Lib/pydoc_data')
-rw-r--r--Lib/pydoc_data/topics.py977
1 files changed, 607 insertions, 370 deletions
diff --git a/Lib/pydoc_data/topics.py b/Lib/pydoc_data/topics.py
index 7c1bdc4..d453c1f 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 Nov 22 11:44:32 2023
+# Autogenerated by Sphinx on Wed Jan 17 13:09:41 2024
# as part of the release process.
topics = {'assert': 'The "assert" statement\n'
'**********************\n'
@@ -864,19 +864,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'
@@ -1111,16 +1117,23 @@ topics = {'assert': 'The "assert" statement\n'
'attribute references, which most objects do. This '
'object is then\n'
'asked to produce the attribute whose name is the '
- 'identifier. This\n'
- 'production can be customized by overriding the '
- '"__getattr__()" method.\n'
- 'If this attribute is not available, the exception '
- '"AttributeError" is\n'
- 'raised. Otherwise, the type and value of the object '
- 'produced is\n'
- 'determined by the object. Multiple evaluations of '
- 'the same attribute\n'
- 'reference may yield different objects.\n',
+ 'identifier. The type\n'
+ 'and value produced is determined by the object. '
+ 'Multiple evaluations\n'
+ 'of the same attribute reference may yield different '
+ 'objects.\n'
+ '\n'
+ 'This production can be customized by overriding the\n'
+ '"__getattribute__()" method or the "__getattr__()" '
+ 'method. The\n'
+ '"__getattribute__()" method is called first and '
+ 'either returns a value\n'
+ 'or raises "AttributeError" if the attribute is not '
+ 'available.\n'
+ '\n'
+ 'If an "AttributeError" is raised and the object has '
+ 'a "__getattr__()"\n'
+ 'method, that method is called as a fallback.\n',
'augassign': 'Augmented assignment statements\n'
'*******************************\n'
'\n'
@@ -3045,8 +3058,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'
@@ -3700,7 +3712,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 '
@@ -3708,6 +3720,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'
@@ -4824,8 +4841,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'
@@ -5565,10 +5582,31 @@ topics = {'assert': 'The "assert" statement\n'
'whose\n'
' global namespace contains all the (global and local) names '
'found in\n'
- ' the current scope.\n'
+ ' the current scope. Use "exit()" or "quit()" to exit the '
+ 'interpreter\n'
+ ' 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'
'\n'
' New in version 3.2.\n'
'\n'
+ ' New in version 3.13: "exit()" and "quit()" can be used to '
+ 'exit\n'
+ ' "interact" command.\n'
+ '\n'
+ ' Changed in version 3.13: "interact" directs its output to '
+ 'the\n'
+ ' debugger’s output channel rather than "sys.stderr".\n'
+ '\n'
'alias [name [command]]\n'
'\n'
' Create an alias called *name* that executes *command*. The\n'
@@ -6554,7 +6592,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'
@@ -6689,12 +6727,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 '
@@ -7509,13 +7546,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'
@@ -9212,15 +9254,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'
@@ -9246,6 +9286,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 '
@@ -9253,6 +9295,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 '
@@ -9271,6 +9314,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 '
@@ -9278,6 +9323,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 '
@@ -9466,23 +9512,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'
@@ -10204,8 +10247,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'
@@ -10483,19 +10526,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'
@@ -10742,7 +10791,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'
@@ -11429,22 +11478,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'
@@ -13043,12 +13090,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'
@@ -13952,130 +13998,117 @@ 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'
- '| "__type_params__" | A tuple containing the type | '
- 'Writable |\n'
- '| | parameters of a generic '
- '| |\n'
- '| | function. '
- '| |\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'
+ '| function.__type_params__ | A "tuple" '
+ 'containing the type parameters of a |\n'
+ '| | generic '
+ 'function. New in version 3.12. |\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'
@@ -14085,14 +14118,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'
@@ -14101,24 +14154,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__") '
@@ -14129,7 +14178,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'
@@ -14217,13 +14266,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'
@@ -14235,7 +14289,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'
@@ -14267,16 +14323,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'
@@ -14350,14 +14405,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'
@@ -14480,43 +14534,106 @@ 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, '
- 'is\n'
- 'deprecated since 3.12 and may be removed in 3.14); "co_stacksize" '
- 'is\n'
- 'the required stack size; "co_flags" is an integer encoding a number '
- 'of\n'
- '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. Deprecated since |\n'
+ '| | version '
+ '3.12: This attribute of code objects is |\n'
+ '| | deprecated, '
+ 'and may be removed in Python 3.14. |\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'
@@ -14525,7 +14642,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'
@@ -14544,16 +14663,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'
@@ -14591,51 +14713,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'
@@ -14643,7 +14867,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'
@@ -14664,11 +14888,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 '
@@ -14691,30 +14918,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'
@@ -15291,7 +15528,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'
@@ -15299,8 +15536,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 '
@@ -15315,7 +15552,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'
@@ -15340,7 +15577,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'