aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Lib/pydoc_data/topics.py
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.com>2023-10-03 23:32:21 +0300
committershadchin <shadchin@yandex-team.com>2023-10-03 23:48:51 +0300
commit01ffd024041ac933854c367fb8d1b5682d19883f (patch)
treeb70aa497ba132a133ccece49f7763427dcd0743f /contrib/tools/python3/src/Lib/pydoc_data/topics.py
parenta33fdb9a34581fd124e92535153b1f1fdeca6aaf (diff)
downloadydb-01ffd024041ac933854c367fb8d1b5682d19883f.tar.gz
Update Python 3 to 3.11.6
Diffstat (limited to 'contrib/tools/python3/src/Lib/pydoc_data/topics.py')
-rw-r--r--contrib/tools/python3/src/Lib/pydoc_data/topics.py2037
1 files changed, 1030 insertions, 1007 deletions
diff --git a/contrib/tools/python3/src/Lib/pydoc_data/topics.py b/contrib/tools/python3/src/Lib/pydoc_data/topics.py
index 1b1251b690..06422d21c6 100644
--- a/contrib/tools/python3/src/Lib/pydoc_data/topics.py
+++ b/contrib/tools/python3/src/Lib/pydoc_data/topics.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# Autogenerated by Sphinx on Thu Aug 24 13:07:17 2023
+# Autogenerated by Sphinx on Mon Oct 2 14:27:48 2023
# as part of the release process.
topics = {'assert': 'The "assert" statement\n'
'**********************\n'
@@ -1076,9 +1076,7 @@ topics = {'assert': 'The "assert" statement\n'
'for each\n'
' instance.\n'
'\n'
- '\n'
- 'Notes on using *__slots__*\n'
- '--------------------------\n'
+ 'Notes on using *__slots__*:\n'
'\n'
'* When inheriting from a class without *__slots__*, the '
'"__dict__" and\n'
@@ -10003,9 +10001,7 @@ topics = {'assert': 'The "assert" statement\n'
'each\n'
' instance.\n'
'\n'
- '\n'
- 'Notes on using *__slots__*\n'
- '~~~~~~~~~~~~~~~~~~~~~~~~~~\n'
+ 'Notes on using *__slots__*:\n'
'\n'
'* When inheriting from a class without *__slots__*, the '
'"__dict__" and\n'
@@ -12374,71 +12370,71 @@ topics = {'assert': 'The "assert" statement\n'
'those\n'
'used by Standard C. The recognized escape sequences are:\n'
'\n'
- '+-------------------+-----------------------------------+---------+\n'
- '| Escape Sequence | Meaning | Notes '
- '|\n'
- '|===================|===================================|=========|\n'
- '| "\\"<newline> | Backslash and newline ignored | '
- '(1) |\n'
- '+-------------------+-----------------------------------+---------+\n'
- '| "\\\\" | Backslash ("\\") '
- '| |\n'
- '+-------------------+-----------------------------------+---------+\n'
- '| "\\\'" | Single quote ("\'") '
+ '+---------------------------+-----------------------------------+---------+\n'
+ '| Escape Sequence | Meaning | '
+ 'Notes |\n'
+ '|===========================|===================================|=========|\n'
+ '| "\\"<newline> | Backslash and newline ignored '
+ '| (1) |\n'
+ '+---------------------------+-----------------------------------+---------+\n'
+ '| "\\\\" | Backslash '
+ '("\\") | |\n'
+ '+---------------------------+-----------------------------------+---------+\n'
+ '| "\\\'" | Single quote '
+ '("\'") | |\n'
+ '+---------------------------+-----------------------------------+---------+\n'
+ '| "\\"" | Double quote (""") '
'| |\n'
- '+-------------------+-----------------------------------+---------+\n'
- '| "\\"" | Double quote (""") '
+ '+---------------------------+-----------------------------------+---------+\n'
+ '| "\\a" | ASCII Bell (BEL) '
'| |\n'
- '+-------------------+-----------------------------------+---------+\n'
- '| "\\a" | ASCII Bell (BEL) '
+ '+---------------------------+-----------------------------------+---------+\n'
+ '| "\\b" | ASCII Backspace (BS) '
'| |\n'
- '+-------------------+-----------------------------------+---------+\n'
- '| "\\b" | ASCII Backspace (BS) '
+ '+---------------------------+-----------------------------------+---------+\n'
+ '| "\\f" | ASCII Formfeed (FF) '
'| |\n'
- '+-------------------+-----------------------------------+---------+\n'
- '| "\\f" | ASCII Formfeed (FF) '
+ '+---------------------------+-----------------------------------+---------+\n'
+ '| "\\n" | ASCII Linefeed (LF) '
'| |\n'
- '+-------------------+-----------------------------------+---------+\n'
- '| "\\n" | ASCII Linefeed (LF) '
+ '+---------------------------+-----------------------------------+---------+\n'
+ '| "\\r" | ASCII Carriage Return (CR) '
'| |\n'
- '+-------------------+-----------------------------------+---------+\n'
- '| "\\r" | ASCII Carriage Return (CR) '
+ '+---------------------------+-----------------------------------+---------+\n'
+ '| "\\t" | ASCII Horizontal Tab (TAB) '
'| |\n'
- '+-------------------+-----------------------------------+---------+\n'
- '| "\\t" | ASCII Horizontal Tab (TAB) '
+ '+---------------------------+-----------------------------------+---------+\n'
+ '| "\\v" | ASCII Vertical Tab (VT) '
'| |\n'
- '+-------------------+-----------------------------------+---------+\n'
- '| "\\v" | ASCII Vertical Tab (VT) '
- '| |\n'
- '+-------------------+-----------------------------------+---------+\n'
- '| "\\ooo" | Character with octal value *ooo* | '
- '(2,4) |\n'
- '+-------------------+-----------------------------------+---------+\n'
- '| "\\xhh" | Character with hex value *hh* | '
- '(3,4) |\n'
- '+-------------------+-----------------------------------+---------+\n'
+ '+---------------------------+-----------------------------------+---------+\n'
+ '| "\\*ooo*" | Character with octal value *ooo* '
+ '| (2,4) |\n'
+ '+---------------------------+-----------------------------------+---------+\n'
+ '| "\\x*hh*" | Character with hex value *hh* '
+ '| (3,4) |\n'
+ '+---------------------------+-----------------------------------+---------+\n'
'\n'
'Escape sequences only recognized in string literals are:\n'
'\n'
- '+-------------------+-----------------------------------+---------+\n'
- '| Escape Sequence | Meaning | Notes '
- '|\n'
- '|===================|===================================|=========|\n'
- '| "\\N{name}" | Character named *name* in the | '
- '(5) |\n'
- '| | Unicode database | '
- '|\n'
- '+-------------------+-----------------------------------+---------+\n'
- '| "\\uxxxx" | Character with 16-bit hex value | '
- '(6) |\n'
- '| | *xxxx* | '
- '|\n'
- '+-------------------+-----------------------------------+---------+\n'
- '| "\\Uxxxxxxxx" | Character with 32-bit hex value | '
- '(7) |\n'
- '| | *xxxxxxxx* | '
- '|\n'
- '+-------------------+-----------------------------------+---------+\n'
+ '+---------------------------+-----------------------------------+---------+\n'
+ '| Escape Sequence | Meaning | '
+ 'Notes |\n'
+ '|===========================|===================================|=========|\n'
+ '| "\\N{*name*}" | Character named *name* in the '
+ '| (5) |\n'
+ '| | Unicode database '
+ '| |\n'
+ '+---------------------------+-----------------------------------+---------+\n'
+ '| "\\u*xxxx*" | Character with 16-bit hex value '
+ '| (6) |\n'
+ '| | *xxxx* '
+ '| |\n'
+ '+---------------------------+-----------------------------------+---------+\n'
+ '| "\\U*xxxxxxxx*" | Character with 32-bit hex value '
+ '| (7) |\n'
+ '| | *xxxxxxxx* '
+ '| |\n'
+ '+---------------------------+-----------------------------------+---------+\n'
'\n'
'Notes:\n'
'\n'
@@ -12896,1145 +12892,1172 @@ topics = {'assert': 'The "assert" statement\n'
'definition\n'
'may change in the future.\n'
'\n'
+ '\n'
'None\n'
- ' This type has a single value. There is a single object with '
- 'this\n'
- ' value. This object is accessed through the built-in name "None". '
- 'It\n'
- ' is used to signify the absence of a value in many situations, '
- 'e.g.,\n'
- ' it is returned from functions that don’t explicitly return\n'
- ' anything. Its truth value is false.\n'
+ '====\n'
+ '\n'
+ 'This type has a single value. There is a single object with this\n'
+ 'value. This object is accessed through the built-in name "None". It '
+ 'is\n'
+ 'used to signify the absence of a value in many situations, e.g., it '
+ 'is\n'
+ 'returned from functions that don’t explicitly return anything. Its\n'
+ 'truth value is false.\n'
+ '\n'
'\n'
'NotImplemented\n'
- ' This type has a single value. There is a single object with '
- 'this\n'
- ' value. This object is accessed through the built-in name\n'
- ' "NotImplemented". Numeric methods and rich comparison methods\n'
- ' should return this value if they do not implement the operation '
- 'for\n'
- ' the operands provided. (The interpreter will then try the\n'
- ' reflected operation, or some other fallback, depending on the\n'
- ' operator.) It should not be evaluated in a boolean context.\n'
+ '==============\n'
+ '\n'
+ 'This type has a single value. There is a single object with this\n'
+ 'value. This object is accessed through the built-in name\n'
+ '"NotImplemented". Numeric methods and rich comparison methods '
+ 'should\n'
+ 'return this value if they do not implement the operation for the\n'
+ 'operands provided. (The interpreter will then try the reflected\n'
+ 'operation, or some other fallback, depending on the operator.) It\n'
+ 'should not be evaluated in a boolean context.\n'
'\n'
- ' See Implementing the arithmetic operations for more details.\n'
+ 'See Implementing the arithmetic operations for more details.\n'
+ '\n'
+ 'Changed in version 3.9: Evaluating "NotImplemented" in a boolean\n'
+ 'context is deprecated. While it currently evaluates as true, it '
+ 'will\n'
+ 'emit a "DeprecationWarning". It will raise a "TypeError" in a '
+ 'future\n'
+ 'version of Python.\n'
'\n'
- ' Changed in version 3.9: Evaluating "NotImplemented" in a '
- 'boolean\n'
- ' context is deprecated. While it currently evaluates as true, it\n'
- ' will emit a "DeprecationWarning". It will raise a "TypeError" in '
- 'a\n'
- ' future version of Python.\n'
'\n'
'Ellipsis\n'
- ' This type has a single value. There is a single object with '
- 'this\n'
- ' value. This object is accessed through the literal "..." or the\n'
- ' built-in name "Ellipsis". Its truth value is true.\n'
+ '========\n'
+ '\n'
+ 'This type has a single value. There is a single object with this\n'
+ 'value. This object is accessed through the literal "..." or the '
+ 'built-\n'
+ 'in name "Ellipsis". Its truth value is true.\n'
+ '\n'
'\n'
'"numbers.Number"\n'
- ' These are created by numeric literals and returned as results '
- 'by\n'
- ' arithmetic operators and arithmetic built-in functions. '
- 'Numeric\n'
- ' objects are immutable; once created their value never changes.\n'
- ' Python numbers are of course strongly related to mathematical\n'
- ' numbers, but subject to the limitations of numerical '
- 'representation\n'
- ' in computers.\n'
- '\n'
- ' The string representations of the numeric classes, computed by\n'
- ' "__repr__()" and "__str__()", have the following properties:\n'
- '\n'
- ' * They are valid numeric literals which, when passed to their '
+ '================\n'
+ '\n'
+ 'These are created by numeric literals and returned as results by\n'
+ 'arithmetic operators and arithmetic built-in functions. Numeric\n'
+ 'objects are immutable; once created their value never changes. '
+ 'Python\n'
+ 'numbers are of course strongly related to mathematical numbers, '
+ 'but\n'
+ 'subject to the limitations of numerical representation in '
+ 'computers.\n'
+ '\n'
+ 'The string representations of the numeric classes, computed by\n'
+ '"__repr__()" and "__str__()", have the following properties:\n'
+ '\n'
+ '* They are valid numeric literals which, when passed to their '
'class\n'
- ' constructor, produce an object having the value of the '
- 'original\n'
- ' numeric.\n'
+ ' constructor, produce an object having the value of the original\n'
+ ' numeric.\n'
'\n'
- ' * The representation is in base 10, when possible.\n'
+ '* The representation is in base 10, when possible.\n'
'\n'
- ' * Leading zeros, possibly excepting a single zero before a '
- 'decimal\n'
- ' point, are not shown.\n'
+ '* Leading zeros, possibly excepting a single zero before a decimal\n'
+ ' point, are not shown.\n'
'\n'
- ' * Trailing zeros, possibly excepting a single zero after a '
- 'decimal\n'
- ' point, are not shown.\n'
+ '* Trailing zeros, possibly excepting a single zero after a decimal\n'
+ ' point, are not shown.\n'
'\n'
- ' * A sign is shown only when the number is negative.\n'
+ '* A sign is shown only when the number is negative.\n'
'\n'
- ' Python distinguishes between integers, floating point numbers, '
- 'and\n'
- ' complex numbers:\n'
+ 'Python distinguishes between integers, floating point numbers, and\n'
+ 'complex numbers:\n'
'\n'
- ' "numbers.Integral"\n'
- ' These represent elements from the mathematical set of '
- 'integers\n'
- ' (positive and negative).\n'
'\n'
- ' There are two types of integers:\n'
+ '"numbers.Integral"\n'
+ '------------------\n'
'\n'
- ' Integers ("int")\n'
- ' These represent numbers in an unlimited range, subject to\n'
- ' available (virtual) memory only. For the purpose of '
- 'shift\n'
- ' and mask operations, a binary representation is assumed, '
- 'and\n'
- ' negative numbers are represented in a variant of 2’s\n'
- ' complement which gives the illusion of an infinite string '
- 'of\n'
- ' sign bits extending to the left.\n'
+ 'These represent elements from the mathematical set of integers\n'
+ '(positive and negative).\n'
'\n'
- ' Booleans ("bool")\n'
- ' These represent the truth values False and True. The two\n'
- ' objects representing the values "False" and "True" are '
- 'the\n'
- ' only Boolean objects. The Boolean type is a subtype of '
+ 'Note:\n'
+ '\n'
+ ' The rules for integer representation are intended to give the '
+ 'most\n'
+ ' meaningful interpretation of shift and mask operations involving\n'
+ ' negative integers.\n'
+ '\n'
+ 'There are two types of integers:\n'
+ '\n'
+ 'Integers ("int")\n'
+ ' These represent numbers in an unlimited range, subject to '
+ 'available\n'
+ ' (virtual) memory only. For the purpose of shift and mask\n'
+ ' operations, a binary representation is assumed, and negative\n'
+ ' numbers are represented in a variant of 2’s complement which '
+ 'gives\n'
+ ' the illusion of an infinite string of sign bits extending to '
'the\n'
- ' integer type, and Boolean values behave like the values 0 '
- 'and\n'
- ' 1, respectively, in almost all contexts, the exception '
- 'being\n'
- ' that when converted to a string, the strings ""False"" or\n'
- ' ""True"" are returned, respectively.\n'
+ ' left.\n'
+ '\n'
+ 'Booleans ("bool")\n'
+ ' These represent the truth values False and True. The two '
+ 'objects\n'
+ ' representing the values "False" and "True" are the only Boolean\n'
+ ' objects. The Boolean type is a subtype of the integer type, and\n'
+ ' Boolean values behave like the values 0 and 1, respectively, in\n'
+ ' almost all contexts, the exception being that when converted to '
+ 'a\n'
+ ' string, the strings ""False"" or ""True"" are returned,\n'
+ ' respectively.\n'
+ '\n'
+ '\n'
+ '"numbers.Real" ("float")\n'
+ '------------------------\n'
'\n'
- ' The rules for integer representation are intended to give '
+ 'These represent machine-level double precision floating point '
+ 'numbers.\n'
+ 'You are at the mercy of the underlying machine architecture (and C '
+ 'or\n'
+ 'Java implementation) for the accepted range and handling of '
+ 'overflow.\n'
+ 'Python does not support single-precision floating point numbers; '
'the\n'
- ' most meaningful interpretation of shift and mask operations\n'
- ' involving negative integers.\n'
- '\n'
- ' "numbers.Real" ("float")\n'
- ' These represent machine-level double precision floating '
- 'point\n'
- ' numbers. You are at the mercy of the underlying machine\n'
- ' architecture (and C or Java implementation) for the accepted\n'
- ' range and handling of overflow. Python does not support '
- 'single-\n'
- ' precision floating point numbers; the savings in processor '
- 'and\n'
- ' memory usage that are usually the reason for using these are\n'
- ' dwarfed by the overhead of using objects in Python, so there '
- 'is\n'
- ' no reason to complicate the language with two kinds of '
- 'floating\n'
- ' point numbers.\n'
- '\n'
- ' "numbers.Complex" ("complex")\n'
- ' These represent complex numbers as a pair of machine-level\n'
- ' double precision floating point numbers. The same caveats '
- 'apply\n'
- ' as for floating point numbers. The real and imaginary parts '
- 'of a\n'
- ' complex number "z" can be retrieved through the read-only\n'
- ' attributes "z.real" and "z.imag".\n'
+ 'savings in processor and memory usage that are usually the reason '
+ 'for\n'
+ 'using these are dwarfed by the overhead of using objects in Python, '
+ 'so\n'
+ 'there is no reason to complicate the language with two kinds of\n'
+ 'floating point numbers.\n'
+ '\n'
+ '\n'
+ '"numbers.Complex" ("complex")\n'
+ '-----------------------------\n'
+ '\n'
+ 'These represent complex numbers as a pair of machine-level double\n'
+ 'precision floating point numbers. The same caveats apply as for\n'
+ 'floating point numbers. The real and imaginary parts of a complex\n'
+ 'number "z" can be retrieved through the read-only attributes '
+ '"z.real"\n'
+ 'and "z.imag".\n'
+ '\n'
'\n'
'Sequences\n'
- ' These represent finite ordered sets indexed by non-negative\n'
- ' numbers. The built-in function "len()" returns the number of '
- 'items\n'
- ' of a sequence. When the length of a sequence is *n*, the index '
+ '=========\n'
+ '\n'
+ 'These represent finite ordered sets indexed by non-negative '
+ 'numbers.\n'
+ 'The built-in function "len()" returns the number of items of a\n'
+ 'sequence. When the length of a sequence is *n*, the index set '
+ 'contains\n'
+ 'the numbers 0, 1, …, *n*-1. Item *i* of sequence *a* is selected '
+ 'by\n'
+ '"a[i]".\n'
+ '\n'
+ 'Sequences also support slicing: "a[i:j]" selects all items with '
+ 'index\n'
+ '*k* such that *i* "<=" *k* "<" *j*. When used as an expression, a\n'
+ 'slice is a sequence of the same type. This implies that the index '
'set\n'
- ' contains the numbers 0, 1, …, *n*-1. Item *i* of sequence *a* '
- 'is\n'
- ' selected by "a[i]".\n'
+ 'is renumbered so that it starts at 0.\n'
'\n'
- ' Sequences also support slicing: "a[i:j]" selects all items with\n'
- ' index *k* such that *i* "<=" *k* "<" *j*. When used as an\n'
- ' expression, a slice is a sequence of the same type. This '
- 'implies\n'
- ' that the index set is renumbered so that it starts at 0.\n'
+ 'Some sequences also support “extended slicing” with a third “step”\n'
+ 'parameter: "a[i:j:k]" selects all items of *a* with index *x* where '
+ '"x\n'
+ '= i + n*k", *n* ">=" "0" and *i* "<=" *x* "<" *j*.\n'
'\n'
- ' Some sequences also support “extended slicing” with a third '
- '“step”\n'
- ' parameter: "a[i:j:k]" selects all items of *a* with index *x* '
- 'where\n'
- ' "x = i + n*k", *n* ">=" "0" and *i* "<=" *x* "<" *j*.\n'
+ 'Sequences are distinguished according to their mutability:\n'
'\n'
- ' Sequences are distinguished according to their mutability:\n'
'\n'
- ' Immutable sequences\n'
- ' An object of an immutable sequence type cannot change once it '
- 'is\n'
- ' created. (If the object contains references to other '
- 'objects,\n'
- ' these other objects may be mutable and may be changed; '
- 'however,\n'
- ' the collection of objects directly referenced by an '
- 'immutable\n'
- ' object cannot change.)\n'
+ 'Immutable sequences\n'
+ '-------------------\n'
'\n'
- ' The following types are immutable sequences:\n'
+ 'An object of an immutable sequence type cannot change once it is\n'
+ 'created. (If the object contains references to other objects, '
+ 'these\n'
+ 'other objects may be mutable and may be changed; however, the\n'
+ 'collection of objects directly referenced by an immutable object\n'
+ 'cannot change.)\n'
'\n'
- ' Strings\n'
- ' A string is a sequence of values that represent Unicode '
- 'code\n'
- ' points. All the code points in the range "U+0000 - '
- 'U+10FFFF"\n'
- ' can be represented in a string. Python doesn’t have a '
- 'char\n'
- ' type; instead, every code point in the string is '
- 'represented\n'
- ' as a string object with length "1". The built-in '
- 'function\n'
- ' "ord()" converts a code point from its string form to an\n'
- ' integer in the range "0 - 10FFFF"; "chr()" converts an\n'
- ' integer in the range "0 - 10FFFF" to the corresponding '
- 'length\n'
- ' "1" string object. "str.encode()" can be used to convert '
- 'a\n'
- ' "str" to "bytes" using the given text encoding, and\n'
- ' "bytes.decode()" can be used to achieve the opposite.\n'
+ 'The following types are immutable sequences:\n'
'\n'
- ' Tuples\n'
- ' The items of a tuple are arbitrary Python objects. Tuples '
- 'of\n'
- ' two or more items are formed by comma-separated lists of\n'
- ' expressions. A tuple of one item (a ‘singleton’) can be\n'
- ' formed by affixing a comma to an expression (an expression '
- 'by\n'
- ' itself does not create a tuple, since parentheses must be\n'
- ' usable for grouping of expressions). An empty tuple can '
+ 'Strings\n'
+ ' A string is a sequence of values that represent Unicode code\n'
+ ' points. All the code points in the range "U+0000 - U+10FFFF" can '
'be\n'
- ' formed by an empty pair of parentheses.\n'
- '\n'
- ' Bytes\n'
- ' A bytes object is an immutable array. The items are '
- '8-bit\n'
- ' bytes, represented by integers in the range 0 <= x < 256.\n'
- ' Bytes literals (like "b\'abc\'") and the built-in '
- '"bytes()"\n'
- ' constructor can be used to create bytes objects. Also, '
- 'bytes\n'
- ' objects can be decoded to strings via the "decode()" '
- 'method.\n'
+ ' represented in a string. Python doesn’t have a char type; '
+ 'instead,\n'
+ ' every code point in the string is represented as a string '
+ 'object\n'
+ ' with length "1". The built-in function "ord()" converts a code\n'
+ ' point from its string form to an integer in the range "0 - '
+ '10FFFF";\n'
+ ' "chr()" converts an integer in the range "0 - 10FFFF" to the\n'
+ ' corresponding length "1" string object. "str.encode()" can be '
+ 'used\n'
+ ' to convert a "str" to "bytes" using the given text encoding, '
+ 'and\n'
+ ' "bytes.decode()" can be used to achieve the opposite.\n'
'\n'
- ' Mutable sequences\n'
- ' Mutable sequences can be changed after they are created. '
- 'The\n'
- ' subscription and slicing notations can be used as the target '
+ 'Tuples\n'
+ ' The items of a tuple are arbitrary Python objects. Tuples of two '
+ 'or\n'
+ ' more items are formed by comma-separated lists of expressions. '
+ 'A\n'
+ ' tuple of one item (a ‘singleton’) can be formed by affixing a '
+ 'comma\n'
+ ' to an expression (an expression by itself does not create a '
+ 'tuple,\n'
+ ' since parentheses must be usable for grouping of expressions). '
+ 'An\n'
+ ' empty tuple can be formed by an empty pair of parentheses.\n'
+ '\n'
+ 'Bytes\n'
+ ' A bytes object is an immutable array. The items are 8-bit '
+ 'bytes,\n'
+ ' represented by integers in the range 0 <= x < 256. Bytes '
+ 'literals\n'
+ ' (like "b\'abc\'") and the built-in "bytes()" constructor can be '
+ 'used\n'
+ ' to create bytes objects. Also, bytes objects can be decoded to\n'
+ ' strings via the "decode()" method.\n'
+ '\n'
+ '\n'
+ 'Mutable sequences\n'
+ '-----------------\n'
+ '\n'
+ 'Mutable sequences can be changed after they are created. The\n'
+ 'subscription and slicing notations can be used as the target of\n'
+ 'assignment and "del" (delete) statements.\n'
+ '\n'
+ 'Note:\n'
+ '\n'
+ ' The "collections" and "array" module provide additional examples '
'of\n'
- ' assignment and "del" (delete) statements.\n'
+ ' mutable sequence types.\n'
'\n'
- ' There are currently two intrinsic mutable sequence types:\n'
+ 'There are currently two intrinsic mutable sequence types:\n'
'\n'
- ' Lists\n'
- ' The items of a list are arbitrary Python objects. Lists '
- 'are\n'
- ' formed by placing a comma-separated list of expressions '
- 'in\n'
- ' square brackets. (Note that there are no special cases '
- 'needed\n'
- ' to form lists of length 0 or 1.)\n'
+ 'Lists\n'
+ ' The items of a list are arbitrary Python objects. Lists are '
+ 'formed\n'
+ ' by placing a comma-separated list of expressions in square\n'
+ ' brackets. (Note that there are no special cases needed to form\n'
+ ' lists of length 0 or 1.)\n'
'\n'
- ' Byte Arrays\n'
- ' A bytearray object is a mutable array. They are created '
- 'by\n'
- ' the built-in "bytearray()" constructor. Aside from being\n'
- ' mutable (and hence unhashable), byte arrays otherwise '
- 'provide\n'
- ' the same interface and functionality as immutable "bytes"\n'
- ' objects.\n'
+ 'Byte Arrays\n'
+ ' A bytearray object is a mutable array. They are created by the\n'
+ ' built-in "bytearray()" constructor. Aside from being mutable '
+ '(and\n'
+ ' hence unhashable), byte arrays otherwise provide the same '
+ 'interface\n'
+ ' and functionality as immutable "bytes" objects.\n'
'\n'
- ' The extension module "array" provides an additional example '
- 'of a\n'
- ' mutable sequence type, as does the "collections" module.\n'
'\n'
'Set types\n'
- ' These represent unordered, finite sets of unique, immutable\n'
- ' objects. As such, they cannot be indexed by any subscript. '
- 'However,\n'
- ' they can be iterated over, and the built-in function "len()"\n'
- ' returns the number of items in a set. Common uses for sets are '
- 'fast\n'
- ' membership testing, removing duplicates from a sequence, and\n'
- ' computing mathematical operations such as intersection, union,\n'
- ' difference, and symmetric difference.\n'
- '\n'
- ' For set elements, the same immutability rules apply as for\n'
- ' dictionary keys. Note that numeric types obey the normal rules '
- 'for\n'
- ' numeric comparison: if two numbers compare equal (e.g., "1" and\n'
- ' "1.0"), only one of them can be contained in a set.\n'
+ '=========\n'
+ '\n'
+ 'These represent unordered, finite sets of unique, immutable '
+ 'objects.\n'
+ 'As such, they cannot be indexed by any subscript. However, they can '
+ 'be\n'
+ 'iterated over, and the built-in function "len()" returns the number '
+ 'of\n'
+ 'items in a set. Common uses for sets are fast membership testing,\n'
+ 'removing duplicates from a sequence, and computing mathematical\n'
+ 'operations such as intersection, union, difference, and symmetric\n'
+ 'difference.\n'
+ '\n'
+ 'For set elements, the same immutability rules apply as for '
+ 'dictionary\n'
+ 'keys. Note that numeric types obey the normal rules for numeric\n'
+ 'comparison: if two numbers compare equal (e.g., "1" and "1.0"), '
+ 'only\n'
+ 'one of them can be contained in a set.\n'
+ '\n'
+ 'There are currently two intrinsic set types:\n'
'\n'
- ' There are currently two intrinsic set types:\n'
+ 'Sets\n'
+ ' These represent a mutable set. They are created by the built-in\n'
+ ' "set()" constructor and can be modified afterwards by several\n'
+ ' methods, such as "add()".\n'
'\n'
- ' Sets\n'
- ' These represent a mutable set. They are created by the '
+ 'Frozen sets\n'
+ ' These represent an immutable set. They are created by the '
'built-in\n'
- ' "set()" constructor and can be modified afterwards by '
- 'several\n'
- ' methods, such as "add()".\n'
- '\n'
- ' Frozen sets\n'
- ' These represent an immutable set. They are created by the\n'
- ' built-in "frozenset()" constructor. As a frozenset is '
- 'immutable\n'
- ' and *hashable*, it can be used again as an element of '
- 'another\n'
- ' set, or as a dictionary key.\n'
+ ' "frozenset()" constructor. As a frozenset is immutable and\n'
+ ' *hashable*, it can be used again as an element of another set, '
+ 'or\n'
+ ' as a dictionary key.\n'
+ '\n'
'\n'
'Mappings\n'
- ' These represent finite sets of objects indexed by arbitrary '
- 'index\n'
- ' sets. The subscript notation "a[k]" selects the item indexed by '
+ '========\n'
+ '\n'
+ 'These represent finite sets of objects indexed by arbitrary index\n'
+ 'sets. The subscript notation "a[k]" selects the item indexed by '
'"k"\n'
- ' from the mapping "a"; this can be used in expressions and as '
- 'the\n'
- ' target of assignments or "del" statements. The built-in '
- 'function\n'
- ' "len()" returns the number of items in a mapping.\n'
+ 'from the mapping "a"; this can be used in expressions and as the\n'
+ 'target of assignments or "del" statements. The built-in function\n'
+ '"len()" returns the number of items in a mapping.\n'
'\n'
- ' There is currently a single intrinsic mapping type:\n'
+ 'There is currently a single intrinsic mapping type:\n'
'\n'
- ' Dictionaries\n'
- ' These represent finite sets of objects indexed by nearly\n'
- ' arbitrary values. The only types of values not acceptable '
- 'as\n'
- ' keys are values containing lists or dictionaries or other\n'
- ' mutable types that are compared by value rather than by '
- 'object\n'
- ' identity, the reason being that the efficient implementation '
- 'of\n'
- ' dictionaries requires a key’s hash value to remain constant.\n'
- ' Numeric types used for keys obey the normal rules for '
- 'numeric\n'
- ' comparison: if two numbers compare equal (e.g., "1" and '
- '"1.0")\n'
- ' then they can be used interchangeably to index the same\n'
- ' dictionary entry.\n'
- '\n'
- ' Dictionaries preserve insertion order, meaning that keys will '
- 'be\n'
- ' produced in the same order they were added sequentially over '
- 'the\n'
- ' dictionary. Replacing an existing key does not change the '
- 'order,\n'
- ' however removing a key and re-inserting it will add it to '
+ '\n'
+ 'Dictionaries\n'
+ '------------\n'
+ '\n'
+ 'These represent finite sets of objects indexed by nearly arbitrary\n'
+ 'values. The only types of values not acceptable as keys are '
+ 'values\n'
+ 'containing lists or dictionaries or other mutable types that are\n'
+ 'compared by value rather than by object identity, the reason being\n'
+ 'that the efficient implementation of dictionaries requires a key’s\n'
+ 'hash value to remain constant. Numeric types used for keys obey '
'the\n'
- ' end instead of keeping its old place.\n'
+ 'normal rules for numeric comparison: if two numbers compare equal\n'
+ '(e.g., "1" and "1.0") then they can be used interchangeably to '
+ 'index\n'
+ 'the same dictionary entry.\n'
'\n'
- ' Dictionaries are mutable; they can be created by the "{...}"\n'
- ' notation (see section Dictionary displays).\n'
+ 'Dictionaries preserve insertion order, meaning that keys will be\n'
+ 'produced in the same order they were added sequentially over the\n'
+ 'dictionary. Replacing an existing key does not change the order,\n'
+ 'however removing a key and re-inserting it will add it to the end\n'
+ 'instead of keeping its old place.\n'
'\n'
- ' The extension modules "dbm.ndbm" and "dbm.gnu" provide\n'
- ' additional examples of mapping types, as does the '
- '"collections"\n'
- ' module.\n'
+ 'Dictionaries are mutable; they can be created by the "{...}" '
+ 'notation\n'
+ '(see section Dictionary displays).\n'
+ '\n'
+ 'The extension modules "dbm.ndbm" and "dbm.gnu" provide additional\n'
+ 'examples of mapping types, as does the "collections" module.\n'
+ '\n'
+ 'Changed in version 3.7: Dictionaries did not preserve insertion '
+ 'order\n'
+ 'in versions of Python before 3.6. In CPython 3.6, insertion order '
+ 'was\n'
+ 'preserved, but it was considered an implementation detail at that '
+ 'time\n'
+ 'rather than a language guarantee.\n'
'\n'
- ' Changed in version 3.7: Dictionaries did not preserve '
- 'insertion\n'
- ' order in versions of Python before 3.6. In CPython 3.6,\n'
- ' insertion order was preserved, but it was considered an\n'
- ' implementation detail at that time rather than a language\n'
- ' guarantee.\n'
'\n'
'Callable types\n'
- ' These are the types to which the function call operation (see\n'
- ' section Calls) can be applied:\n'
+ '==============\n'
'\n'
- ' User-defined functions\n'
- ' A user-defined function object is created by a function\n'
- ' definition (see section Function definitions). It should be\n'
- ' called with an argument list containing the same number of '
- 'items\n'
- ' as the function’s formal parameter list.\n'
+ 'These are the types to which the function call operation (see '
+ 'section\n'
+ 'Calls) can be applied:\n'
'\n'
- ' Special attributes:\n'
'\n'
- ' '
+ 'User-defined functions\n'
+ '----------------------\n'
+ '\n'
+ 'A user-defined function object is created by a function definition\n'
+ '(see section Function definitions). It should be called with an\n'
+ 'argument list containing the same number of items as the '
+ 'function’s\n'
+ 'formal parameter list.\n'
+ '\n'
+ 'Special attributes:\n'
+ '\n'
'+---------------------------+---------------------------------+-------------+\n'
- ' | Attribute | Meaning '
+ '| Attribute | Meaning '
'| |\n'
- ' '
'|===========================|=================================|=============|\n'
- ' | "__doc__" | The function’s documentation '
- '| Writable |\n'
- ' | | string, or "None" if '
+ '| "__doc__" | The function’s documentation | '
+ 'Writable |\n'
+ '| | string, or "None" if '
'| |\n'
- ' | | unavailable; not inherited by '
+ '| | unavailable; not inherited by '
'| |\n'
- ' | | subclasses. '
+ '| | subclasses. '
'| |\n'
- ' '
'+---------------------------+---------------------------------+-------------+\n'
- ' | "__name__" | The function’s name. '
- '| Writable |\n'
- ' '
+ '| "__name__" | The function’s name. | '
+ 'Writable |\n'
'+---------------------------+---------------------------------+-------------+\n'
- ' | "__qualname__" | The function’s *qualified '
- '| Writable |\n'
- ' | | name*. New in version 3.3. '
+ '| "__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 '
+ '| "__module__" | The name of the module the | '
+ 'Writable |\n'
+ '| | function was defined in, or '
'| |\n'
- ' | | "None" if unavailable. '
+ '| | "None" if unavailable. '
'| |\n'
- ' '
'+---------------------------+---------------------------------+-------------+\n'
- ' | "__defaults__" | A tuple containing default '
- '| Writable |\n'
- ' | | argument values for those '
+ '| "__defaults__" | A tuple containing default | '
+ 'Writable |\n'
+ '| | argument values for those '
'| |\n'
- ' | | arguments that have defaults, '
+ '| | arguments that have defaults, '
'| |\n'
- ' | | or "None" if no arguments have '
+ '| | or "None" if no arguments have '
'| |\n'
- ' | | a default value. '
+ '| | a default value. '
'| |\n'
- ' '
'+---------------------------+---------------------------------+-------------+\n'
- ' | "__code__" | The code object representing '
- '| Writable |\n'
- ' | | the compiled function body. '
+ '| "__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 '
+ '| "__globals__" | A reference to the dictionary | '
+ 'Read-only |\n'
+ '| | that holds the function’s '
'| |\n'
- ' | | global variables — the global '
+ '| | global variables — the global '
'| |\n'
- ' | | namespace of the module in '
+ '| | namespace of the module in '
'| |\n'
- ' | | which the function was defined. '
+ '| | which the function was defined. '
'| |\n'
- ' '
'+---------------------------+---------------------------------+-------------+\n'
- ' | "__dict__" | The namespace supporting '
- '| Writable |\n'
- ' | | arbitrary function attributes. '
+ '| "__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 '
+ '| "__closure__" | "None" or a tuple of cells that | '
+ 'Read-only |\n'
+ '| | contain bindings for the '
'| |\n'
- ' | | function’s free variables. See '
+ '| | function’s free variables. See '
'| |\n'
- ' | | below for information on the '
+ '| | below for information on the '
'| |\n'
- ' | | "cell_contents" attribute. '
+ '| | "cell_contents" attribute. '
'| |\n'
- ' '
'+---------------------------+---------------------------------+-------------+\n'
- ' | "__annotations__" | A dict containing annotations '
- '| Writable |\n'
- ' | | of parameters. The keys of the '
+ '| "__annotations__" | A dict containing annotations | '
+ 'Writable |\n'
+ '| | of parameters. The keys of the '
+ '| |\n'
+ '| | dict are the parameter names, '
'| |\n'
- ' | | dict are the parameter names, '
+ '| | and "\'return\'" for the return '
'| |\n'
- ' | | and "\'return\'" for the '
- 'return | |\n'
- ' | | annotation, if provided. For '
+ '| | annotation, if provided. For '
'| |\n'
- ' | | more information on working '
+ '| | more information on working '
'| |\n'
- ' | | with this attribute, see '
+ '| | with this attribute, see '
'| |\n'
- ' | | Annotations Best Practices. '
+ '| | Annotations Best Practices. '
'| |\n'
- ' '
'+---------------------------+---------------------------------+-------------+\n'
- ' | "__kwdefaults__" | A dict containing defaults for '
- '| Writable |\n'
- ' | | keyword-only parameters. '
+ '| "__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'
+ 'Most of the attributes labelled “Writable” check the type of the\n'
+ 'assigned value.\n'
'\n'
- ' Function objects also support getting and setting arbitrary\n'
- ' attributes, which can be used, for example, to attach '
- 'metadata\n'
- ' to functions. Regular attribute dot-notation is used to get '
- 'and\n'
- ' set such attributes. *Note that the current implementation '
- 'only\n'
- ' supports function attributes on user-defined functions. '
- 'Function\n'
- ' attributes on built-in functions may be supported in the\n'
- ' future.*\n'
- '\n'
- ' A cell object has the attribute "cell_contents". This can be\n'
- ' used to get the value of the cell, as well as set the value.\n'
- '\n'
- ' Additional information about a function’s definition can be\n'
- ' retrieved from its code object; see the description of '
- 'internal\n'
- ' types below. The "cell" type can be accessed in the "types"\n'
- ' module.\n'
- '\n'
- ' Instance methods\n'
- ' An instance method object combines a class, a class instance '
- 'and\n'
- ' any callable object (normally a user-defined function).\n'
- '\n'
- ' Special read-only attributes: "__self__" is the class '
- 'instance\n'
- ' object, "__func__" is the function object; "__doc__" is the\n'
- ' method’s documentation (same as "__func__.__doc__"); '
- '"__name__"\n'
- ' is the method name (same as "__func__.__name__"); '
- '"__module__"\n'
- ' is the name of the module the method was defined in, or '
- '"None"\n'
- ' if unavailable.\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'
'\n'
- ' Methods also support accessing (but not setting) the '
- 'arbitrary\n'
- ' function attributes on the underlying function object.\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'
'\n'
- ' User-defined method objects may be created when getting an\n'
- ' attribute of a class (perhaps via an instance of that class), '
- 'if\n'
- ' that attribute is a user-defined function object or a class\n'
- ' method object.\n'
- '\n'
- ' When an instance method object is created by retrieving a '
- 'user-\n'
- ' defined function object from a class via one of its '
- 'instances,\n'
- ' its "__self__" attribute is the instance, and the method '
- 'object\n'
- ' is said to be bound. The new method’s "__func__" attribute '
- 'is\n'
- ' the original function object.\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'
'\n'
- ' When an instance method object is created by retrieving a '
- 'class\n'
- ' method object from a class or instance, its "__self__" '
- 'attribute\n'
- ' 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\n'
- ' function ("__func__") is called, inserting the class '
- 'instance\n'
- ' ("__self__") in front of the argument list. For instance, '
- 'when\n'
- ' "C" is a class which contains a definition for a function '
- '"f()",\n'
- ' and "x" is an instance of "C", calling "x.f(1)" is equivalent '
- 'to\n'
- ' calling "C.f(x, 1)".\n'
+ 'Instance methods\n'
+ '----------------\n'
+ '\n'
+ 'An instance method object combines a class, a class instance and '
+ 'any\n'
+ 'callable object (normally a user-defined function).\n'
'\n'
- ' When an instance method object is derived from a class '
+ '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'
- ' object, the “class instance” stored in "__self__" will '
- 'actually\n'
- ' be the class itself, so that calling either "x.f(1)" or '
- '"C.f(1)"\n'
- ' is equivalent to calling "f(C,1)" where "f" is the '
- 'underlying\n'
- ' function.\n'
- '\n'
- ' Note that the transformation from function object to '
- 'instance\n'
- ' method object happens each time the attribute is retrieved '
- 'from\n'
- ' the instance. In some cases, a fruitful optimization is to\n'
- ' assign the attribute to a local variable and call that local\n'
- ' variable. Also notice that this transformation only happens '
- 'for\n'
- ' user-defined functions; other callable objects (and all non-\n'
- ' callable objects) are retrieved without transformation. It '
- 'is\n'
- ' also important to note that user-defined functions which are\n'
- ' attributes of a class instance are not converted to bound\n'
- ' methods; this *only* happens when the function is an '
+ 'name (same as "__func__.__name__"); "__module__" is the name of '
+ 'the\n'
+ 'module the method was defined in, or "None" if unavailable.\n'
+ '\n'
+ 'Methods also support accessing (but not setting) the arbitrary\n'
+ 'function attributes on the underlying function object.\n'
+ '\n'
+ 'User-defined method objects may be created when getting an '
+ 'attribute\n'
+ 'of a class (perhaps via an instance of that class), if that '
'attribute\n'
- ' of the class.\n'
+ 'is a user-defined function object or a class method object.\n'
'\n'
- ' Generator functions\n'
- ' A function or method which uses the "yield" statement (see\n'
- ' section The yield statement) is called a *generator '
- 'function*.\n'
- ' Such a function, when called, always returns an *iterator*\n'
- ' object which can be used to execute the body of the '
- 'function:\n'
- ' calling the iterator’s "iterator.__next__()" method will '
- 'cause\n'
- ' the function to execute until it provides a value using the\n'
- ' "yield" statement. When the function executes a "return"\n'
- ' statement or falls off the end, a "StopIteration" exception '
- 'is\n'
- ' raised and the iterator will have reached the end of the set '
+ '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'
+ '\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'
+ '\n'
+ 'When an instance method object is called, the underlying function\n'
+ '("__func__") is called, inserting the class instance ("__self__") '
+ 'in\n'
+ 'front of the argument list. For instance, when "C" is a class '
+ 'which\n'
+ 'contains a definition for a function "f()", and "x" is an instance '
'of\n'
- ' values to be returned.\n'
- '\n'
- ' Coroutine functions\n'
- ' A function or method which is defined using "async def" is\n'
- ' called a *coroutine function*. Such a function, when '
- 'called,\n'
- ' returns a *coroutine* object. It may contain "await"\n'
- ' expressions, as well as "async with" and "async for" '
- 'statements.\n'
- ' See also the Coroutine Objects section.\n'
- '\n'
- ' Asynchronous generator functions\n'
- ' A function or method which is defined using "async def" and\n'
- ' which uses the "yield" statement is called a *asynchronous\n'
- ' generator function*. Such a function, when called, returns '
- 'an\n'
- ' *asynchronous iterator* object which can be used in an '
- '"async\n'
- ' for" statement to execute the body of the function.\n'
+ '"C", calling "x.f(1)" is equivalent to calling "C.f(x, 1)".\n'
'\n'
- ' Calling the asynchronous iterator’s "aiterator.__anext__" '
+ 'When an instance method object is derived from a class method '
+ 'object,\n'
+ 'the “class instance” stored in "__self__" will actually be the '
+ 'class\n'
+ 'itself, so that calling either "x.f(1)" or "C.f(1)" is equivalent '
+ 'to\n'
+ 'calling "f(C,1)" where "f" is the underlying function.\n'
+ '\n'
+ 'Note that the transformation from function object to instance '
'method\n'
- ' will return an *awaitable* which when awaited will execute '
+ 'object happens each time the attribute is retrieved from the '
+ 'instance.\n'
+ 'In some cases, a fruitful optimization is to assign the attribute '
+ 'to a\n'
+ 'local variable and call that local variable. Also notice that this\n'
+ 'transformation only happens for user-defined functions; other '
+ 'callable\n'
+ 'objects (and all non-callable objects) are retrieved without\n'
+ 'transformation. It is also important to note that user-defined\n'
+ 'functions which are attributes of a class instance are not '
+ 'converted\n'
+ 'to bound methods; this *only* happens when the function is an\n'
+ 'attribute of the class.\n'
+ '\n'
+ '\n'
+ 'Generator functions\n'
+ '-------------------\n'
+ '\n'
+ 'A function or method which uses the "yield" statement (see section '
+ 'The\n'
+ 'yield statement) is called a *generator function*. Such a '
+ 'function,\n'
+ 'when called, always returns an *iterator* object which can be used '
+ 'to\n'
+ 'execute the body of the function: calling the iterator’s\n'
+ '"iterator.__next__()" method will cause the function to execute '
'until\n'
- ' it provides a value using the "yield" expression. When the\n'
- ' function executes an empty "return" statement or falls off '
+ 'it provides a value using the "yield" statement. When the '
+ 'function\n'
+ 'executes a "return" statement or falls off the end, a '
+ '"StopIteration"\n'
+ 'exception is raised and the iterator will have reached the end of '
'the\n'
- ' end, a "StopAsyncIteration" exception is raised and the\n'
- ' asynchronous iterator will have reached the end of the set '
- 'of\n'
- ' values to be yielded.\n'
+ 'set of values to be returned.\n'
'\n'
- ' Built-in functions\n'
- ' A built-in function object is a wrapper around a C function.\n'
- ' Examples of built-in functions are "len()" and "math.sin()"\n'
- ' ("math" is a standard built-in module). The number and type '
- 'of\n'
- ' the arguments are determined by the C function. Special '
- 'read-\n'
- ' only attributes: "__doc__" is the function’s documentation\n'
- ' string, or "None" if unavailable; "__name__" is the '
- 'function’s\n'
- ' name; "__self__" is set to "None" (but see the next item);\n'
- ' "__module__" is the name of the module the function was '
- 'defined\n'
- ' in or "None" if unavailable.\n'
'\n'
- ' Built-in methods\n'
- ' This is really a different disguise of a built-in function, '
- 'this\n'
- ' time containing an object passed to the C function as an\n'
- ' implicit extra argument. An example of a built-in method is\n'
- ' "alist.append()", assuming *alist* is a list object. In this\n'
- ' case, the special read-only attribute "__self__" is set to '
+ 'Coroutine functions\n'
+ '-------------------\n'
+ '\n'
+ 'A function or method which is defined using "async def" is called '
+ 'a\n'
+ '*coroutine function*. Such a function, when called, returns a\n'
+ '*coroutine* object. It may contain "await" expressions, as well '
+ 'as\n'
+ '"async with" and "async for" statements. See also the Coroutine\n'
+ 'Objects section.\n'
+ '\n'
+ '\n'
+ 'Asynchronous generator functions\n'
+ '--------------------------------\n'
+ '\n'
+ 'A function or method which is defined using "async def" and which '
+ 'uses\n'
+ 'the "yield" statement is called a *asynchronous generator '
+ 'function*.\n'
+ 'Such a function, when called, returns an *asynchronous iterator*\n'
+ 'object which can be used in an "async for" statement to execute '
'the\n'
- ' object denoted by *alist*.\n'
+ 'body of the function.\n'
+ '\n'
+ 'Calling the asynchronous iterator’s "aiterator.__anext__" method '
+ 'will\n'
+ 'return an *awaitable* which when awaited will execute until it\n'
+ 'provides a value using the "yield" expression. When the function\n'
+ 'executes an empty "return" statement or falls off the end, a\n'
+ '"StopAsyncIteration" exception is raised and the asynchronous '
+ 'iterator\n'
+ 'will have reached the end of the set of values to be yielded.\n'
+ '\n'
+ '\n'
+ 'Built-in functions\n'
+ '------------------\n'
+ '\n'
+ 'A built-in function object is a wrapper around a C function. '
+ 'Examples\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'
+ '\n'
+ '\n'
+ 'Built-in methods\n'
+ '----------------\n'
+ '\n'
+ 'This is really a different disguise of a built-in function, this '
+ 'time\n'
+ 'containing an object passed to the C function as an implicit extra\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'
+ '\n'
+ '\n'
+ 'Classes\n'
+ '-------\n'
+ '\n'
+ 'Classes are callable. These objects normally act as factories for '
+ 'new\n'
+ 'instances of themselves, but variations are possible for class '
+ 'types\n'
+ 'that override "__new__()". The arguments of the call are passed '
+ 'to\n'
+ '"__new__()" and, in the typical case, to "__init__()" to '
+ 'initialize\n'
+ 'the new instance.\n'
'\n'
- ' Classes\n'
- ' Classes are callable. These objects normally act as '
- 'factories\n'
- ' for new instances of themselves, but variations are possible '
- 'for\n'
- ' class types that override "__new__()". The arguments of the\n'
- ' call are passed to "__new__()" and, in the typical case, to\n'
- ' "__init__()" to initialize the new instance.\n'
'\n'
- ' Class Instances\n'
- ' Instances of arbitrary classes can be made callable by '
- 'defining\n'
- ' a "__call__()" method in their class.\n'
+ 'Class Instances\n'
+ '---------------\n'
+ '\n'
+ 'Instances of arbitrary classes can be made callable by defining a\n'
+ '"__call__()" method in their class.\n'
+ '\n'
'\n'
'Modules\n'
- ' Modules are a basic organizational unit of Python code, and are\n'
- ' created by the import system as invoked either by the "import"\n'
- ' statement, or by calling functions such as\n'
- ' "importlib.import_module()" and built-in "__import__()". A '
- 'module\n'
- ' object has a namespace implemented by a dictionary object (this '
- 'is\n'
- ' the dictionary referenced by the "__globals__" attribute of\n'
- ' functions defined in the module). Attribute references are\n'
- ' translated to lookups in this dictionary, e.g., "m.x" is '
- 'equivalent\n'
- ' to "m.__dict__["x"]". A module object does not contain the code\n'
- ' object used to initialize the module (since it isn’t needed '
- 'once\n'
- ' the initialization is done).\n'
+ '=======\n'
+ '\n'
+ 'Modules are a basic organizational unit of Python code, and are\n'
+ 'created by the import system as invoked either by the "import"\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'
+ '\n'
+ 'Attribute assignment updates the module’s namespace dictionary, '
+ 'e.g.,\n'
+ '"m.x = 1" is equivalent to "m.__dict__["x"] = 1".\n'
'\n'
- ' Attribute assignment updates the module’s namespace dictionary,\n'
- ' e.g., "m.x = 1" is equivalent to "m.__dict__["x"] = 1".\n'
+ 'Predefined (writable) attributes:\n'
'\n'
- ' Predefined (writable) attributes:\n'
+ ' "__name__"\n'
+ ' The module’s name.\n'
'\n'
- ' "__name__"\n'
- ' The module’s name.\n'
+ ' "__doc__"\n'
+ ' The module’s documentation string, or "None" if unavailable.\n'
'\n'
- ' "__doc__"\n'
- ' The module’s documentation string, or "None" if '
- 'unavailable.\n'
+ ' "__file__"\n'
+ ' The pathname of the file from which the module was loaded, if '
+ 'it\n'
+ ' was loaded from a file. The "__file__" attribute may be '
+ 'missing\n'
+ ' for certain types of modules, such as C modules that are\n'
+ ' statically linked into the interpreter. For extension '
+ 'modules\n'
+ ' loaded dynamically from a shared library, it’s the pathname '
+ 'of\n'
+ ' the shared library file.\n'
'\n'
- ' "__file__"\n'
- ' The pathname of the file from which the module was loaded, '
- 'if\n'
- ' it was loaded from a file. The "__file__" attribute may '
- 'be\n'
- ' missing for certain types of modules, such as C modules '
- 'that\n'
- ' are statically linked into the interpreter. For '
- 'extension\n'
- ' modules loaded dynamically from a shared library, it’s '
- 'the\n'
- ' pathname of the shared library file.\n'
- '\n'
- ' "__annotations__"\n'
- ' A dictionary containing *variable annotations* collected\n'
- ' during module body execution. For best practices on '
- 'working\n'
- ' with "__annotations__", please see Annotations Best\n'
- ' Practices.\n'
- '\n'
- ' Special read-only attribute: "__dict__" is the module’s '
- 'namespace\n'
- ' as a dictionary object.\n'
- '\n'
- ' **CPython implementation detail:** Because of the way CPython\n'
- ' clears module dictionaries, the module dictionary will be '
- 'cleared\n'
- ' when the module falls out of scope even if the dictionary still '
- 'has\n'
- ' live references. To avoid this, copy the dictionary or keep '
+ ' "__annotations__"\n'
+ ' A dictionary containing *variable annotations* collected '
+ 'during\n'
+ ' module body execution. For best practices on working with\n'
+ ' "__annotations__", please see Annotations Best Practices.\n'
+ '\n'
+ 'Special read-only attribute: "__dict__" is the module’s namespace '
+ 'as a\n'
+ 'dictionary object.\n'
+ '\n'
+ '**CPython implementation detail:** Because of the way CPython '
+ 'clears\n'
+ 'module dictionaries, the module dictionary will be cleared when '
'the\n'
- ' module around while using its dictionary directly.\n'
+ 'module falls out of scope even if the dictionary still has live\n'
+ 'references. To avoid this, copy the dictionary or keep the module\n'
+ 'around while using its dictionary directly.\n'
+ '\n'
'\n'
'Custom classes\n'
- ' Custom class types are typically created by class definitions '
- '(see\n'
- ' section Class definitions). A class has a namespace implemented '
- 'by\n'
- ' a dictionary object. Class attribute references are translated '
- 'to\n'
- ' lookups in this dictionary, e.g., "C.x" is translated to\n'
- ' "C.__dict__["x"]" (although there are a number of hooks which '
+ '==============\n'
+ '\n'
+ 'Custom class types are typically created by class definitions (see\n'
+ 'section Class definitions). A class has a namespace implemented by '
+ 'a\n'
+ 'dictionary object. Class attribute references are translated to\n'
+ 'lookups in this dictionary, e.g., "C.x" is translated to\n'
+ '"C.__dict__["x"]" (although there are a number of hooks which '
'allow\n'
- ' for other means of locating attributes). When the attribute name '
+ 'for other means of locating attributes). When the attribute name '
'is\n'
- ' not found there, the attribute search continues in the base\n'
- ' classes. This search of the base classes uses the C3 method\n'
- ' resolution order which behaves correctly even in the presence '
- 'of\n'
- ' ‘diamond’ inheritance structures where there are multiple\n'
- ' inheritance paths leading back to a common ancestor. Additional\n'
- ' details on the C3 MRO used by Python can be found in the\n'
- ' documentation accompanying the 2.3 release at\n'
- ' https://www.python.org/download/releases/2.3/mro/.\n'
- '\n'
- ' When a class attribute reference (for class "C", say) would '
- 'yield a\n'
- ' class method object, it is transformed into an instance method\n'
- ' object whose "__self__" attribute is "C". When it would yield '
+ 'not found there, the attribute search continues in the base '
+ 'classes.\n'
+ 'This search of the base classes uses the C3 method resolution '
+ 'order\n'
+ 'which behaves correctly even in the presence of ‘diamond’ '
+ 'inheritance\n'
+ 'structures where there are multiple inheritance paths leading back '
+ 'to\n'
+ 'a common ancestor. Additional details on the C3 MRO used by Python '
+ 'can\n'
+ 'be found in the documentation accompanying the 2.3 release at\n'
+ 'https://www.python.org/download/releases/2.3/mro/.\n'
+ '\n'
+ 'When a class attribute reference (for class "C", say) would yield '
'a\n'
- ' static method 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\n'
- ' from those actually contained in its "__dict__".\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'
'\n'
- ' Class attribute assignments update the class’s dictionary, '
- 'never\n'
- ' the dictionary of a base class.\n'
+ 'Class attribute assignments update the class’s dictionary, never '
+ 'the\n'
+ 'dictionary of a base class.\n'
+ '\n'
+ 'A class object can be called (see above) to yield a class instance\n'
+ '(see below).\n'
'\n'
- ' A class object can be called (see above) to yield a class '
- 'instance\n'
- ' (see below).\n'
+ 'Special attributes:\n'
'\n'
- ' Special attributes:\n'
+ ' "__name__"\n'
+ ' The class name.\n'
'\n'
- ' "__name__"\n'
- ' The class name.\n'
+ ' "__module__"\n'
+ ' The name of the module in which the class was defined.\n'
'\n'
- ' "__module__"\n'
- ' The name of the module in which the class was defined.\n'
+ ' "__dict__"\n'
+ ' The dictionary containing the class’s namespace.\n'
'\n'
- ' "__dict__"\n'
- ' The dictionary containing the class’s namespace.\n'
+ ' "__bases__"\n'
+ ' A tuple containing the base classes, in the order of their\n'
+ ' occurrence in the base class list.\n'
'\n'
- ' "__bases__"\n'
- ' A tuple containing the base classes, in the order of '
- 'their\n'
- ' occurrence in the base class list.\n'
+ ' "__doc__"\n'
+ ' The class’s documentation string, or "None" if undefined.\n'
'\n'
- ' "__doc__"\n'
- ' The class’s documentation string, or "None" if undefined.\n'
+ ' "__annotations__"\n'
+ ' A dictionary containing *variable annotations* collected '
+ 'during\n'
+ ' class body execution. For best practices on working with\n'
+ ' "__annotations__", please see Annotations Best Practices.\n'
'\n'
- ' "__annotations__"\n'
- ' A dictionary containing *variable annotations* collected\n'
- ' during class body execution. For best practices on '
- 'working\n'
- ' with "__annotations__", please see Annotations Best\n'
- ' Practices.\n'
'\n'
'Class instances\n'
- ' A class instance is created by calling a class object (see '
- 'above).\n'
- ' A class instance has a namespace implemented as a dictionary '
- 'which\n'
- ' is the first place in which attribute references are searched.\n'
- ' When an attribute is not found there, and the instance’s class '
- 'has\n'
- ' an attribute by that name, the search continues with the class\n'
- ' attributes. If a class attribute is found that is a '
- 'user-defined\n'
- ' function object, it is transformed into an instance method '
- 'object\n'
- ' whose "__self__" attribute is the instance. Static method and\n'
- ' class method objects are also transformed; see above under\n'
- ' “Classes”. See section Implementing Descriptors for another way '
- 'in\n'
- ' which attributes of a class retrieved via its instances may '
- 'differ\n'
- ' from the objects actually stored in the class’s "__dict__". If '
- 'no\n'
- ' class attribute is found, and the object’s class has a\n'
- ' "__getattr__()" method, that is called to satisfy the lookup.\n'
+ '===============\n'
'\n'
- ' Attribute assignments and deletions update the instance’s\n'
- ' dictionary, never a class’s dictionary. If the class has a\n'
- ' "__setattr__()" or "__delattr__()" method, this is called '
- 'instead\n'
- ' of updating the instance dictionary directly.\n'
+ 'A class instance is created by calling a class object (see above). '
+ 'A\n'
+ 'class instance has a namespace implemented as a dictionary which '
+ 'is\n'
+ 'the first place in which attribute references are searched. When '
+ 'an\n'
+ 'attribute is not found there, and the instance’s class has an\n'
+ 'attribute by that name, the search continues with the class\n'
+ 'attributes. If a class attribute is found that is a user-defined\n'
+ 'function object, it is transformed into an instance method object\n'
+ 'whose "__self__" attribute is the instance. Static method and '
+ 'class\n'
+ 'method objects are also transformed; see above under “Classes”. '
+ 'See\n'
+ 'section Implementing Descriptors for another way in which '
+ 'attributes\n'
+ 'of a class retrieved via its instances may differ from the objects\n'
+ 'actually stored in the class’s "__dict__". If no class attribute '
+ 'is\n'
+ 'found, and the object’s class has a "__getattr__()" method, that '
+ 'is\n'
+ 'called to satisfy the lookup.\n'
'\n'
- ' Class instances can pretend to be numbers, sequences, or '
- 'mappings\n'
- ' if they have methods with certain special names. See section\n'
- ' Special method names.\n'
+ 'Attribute assignments and deletions update the instance’s '
+ 'dictionary,\n'
+ 'never a class’s dictionary. If the class has a "__setattr__()" or\n'
+ '"__delattr__()" method, this is called instead of updating the\n'
+ 'instance dictionary directly.\n'
+ '\n'
+ 'Class instances can pretend to be numbers, sequences, or mappings '
+ 'if\n'
+ 'they have methods with certain special names. See section Special\n'
+ 'method names.\n'
+ '\n'
+ 'Special attributes: "__dict__" is the attribute dictionary;\n'
+ '"__class__" is the instance’s class.\n'
'\n'
- ' Special attributes: "__dict__" is the attribute dictionary;\n'
- ' "__class__" is the instance’s class.\n'
'\n'
'I/O objects (also known as file objects)\n'
- ' A *file object* represents an open file. Various shortcuts are\n'
- ' available to create file objects: the "open()" built-in '
- 'function,\n'
- ' and also "os.popen()", "os.fdopen()", and the "makefile()" '
- 'method\n'
- ' of socket objects (and perhaps by other functions or methods\n'
- ' provided by extension modules).\n'
+ '========================================\n'
+ '\n'
+ 'A *file object* represents an open file. Various shortcuts are\n'
+ 'available to create file objects: the "open()" built-in function, '
+ 'and\n'
+ 'also "os.popen()", "os.fdopen()", and the "makefile()" method of\n'
+ 'socket objects (and perhaps by other functions or methods provided '
+ 'by\n'
+ 'extension modules).\n'
+ '\n'
+ 'The objects "sys.stdin", "sys.stdout" and "sys.stderr" are '
+ 'initialized\n'
+ 'to file objects corresponding to the interpreter’s standard input,\n'
+ 'output and error streams; they are all open in text mode and '
+ 'therefore\n'
+ 'follow the interface defined by the "io.TextIOBase" abstract '
+ 'class.\n'
'\n'
- ' The objects "sys.stdin", "sys.stdout" and "sys.stderr" are\n'
- ' initialized to file objects corresponding to the interpreter’s\n'
- ' standard input, output and error streams; they are all open in '
- 'text\n'
- ' mode and therefore follow the interface defined by the\n'
- ' "io.TextIOBase" abstract class.\n'
'\n'
'Internal types\n'
- ' A few types used internally by the interpreter are exposed to '
- 'the\n'
- ' user. Their definitions may change with future versions of the\n'
- ' interpreter, but they are mentioned here for completeness.\n'
- '\n'
- ' Code objects\n'
- ' Code objects represent *byte-compiled* executable Python '
- 'code,\n'
- ' or *bytecode*. The difference between a code object and a\n'
- ' function object is that the function object contains an '
- 'explicit\n'
- ' reference to the function’s globals (the module in which it '
- 'was\n'
- ' defined), while a code object contains no context; also the\n'
- ' default argument values are stored in the function object, '
- 'not\n'
- ' in the code object (because they represent values calculated '
- 'at\n'
- ' run-time). Unlike function objects, code objects are '
- 'immutable\n'
- ' and contain no references (directly or indirectly) to '
- 'mutable\n'
- ' objects.\n'
- '\n'
- ' Special read-only attributes: "co_name" gives the function '
- 'name;\n'
- ' "co_qualname" gives the fully qualified function name;\n'
- ' "co_argcount" is the total number of positional arguments\n'
- ' (including positional-only arguments and arguments with '
- 'default\n'
- ' values); "co_posonlyargcount" is the number of '
- 'positional-only\n'
- ' arguments (including arguments with default values);\n'
- ' "co_kwonlyargcount" is the number of keyword-only arguments\n'
- ' (including arguments with default values); "co_nlocals" is '
- 'the\n'
- ' number of local variables used by the function (including\n'
- ' arguments); "co_varnames" is a tuple containing the names of '
- 'the\n'
- ' local variables (starting with the argument names);\n'
- ' "co_cellvars" is a tuple containing the names of local '
- 'variables\n'
- ' that are referenced by nested functions; "co_freevars" is a\n'
- ' tuple containing the names of free variables; "co_code" is a\n'
- ' string representing the sequence of bytecode instructions;\n'
- ' "co_consts" is a tuple containing the literals used by the\n'
- ' 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\n'
- ' function; "co_lnotab" is a string encoding the mapping from\n'
- ' bytecode offsets to line numbers (for details see the source\n'
- ' code of the interpreter); "co_stacksize" is the required '
- 'stack\n'
- ' size; "co_flags" is an integer encoding a number of flags '
- 'for\n'
- ' the interpreter.\n'
+ '==============\n'
+ '\n'
+ 'A few types used internally by the interpreter are exposed to the\n'
+ 'user. Their definitions may change with future versions of the\n'
+ 'interpreter, but they are mentioned here for completeness.\n'
'\n'
- ' The following flag bits are defined for "co_flags": bit '
- '"0x04"\n'
- ' is set if the function uses the "*arguments" syntax to accept '
- 'an\n'
- ' arbitrary number of positional arguments; bit "0x08" is set '
- 'if\n'
- ' the function uses the "**keywords" syntax to accept '
- 'arbitrary\n'
- ' keyword arguments; bit "0x20" is set if the function is a\n'
- ' generator.\n'
'\n'
- ' Future feature declarations ("from __future__ import '
- 'division")\n'
- ' also use bits in "co_flags" to indicate whether a code '
+ 'Code objects\n'
+ '------------\n'
+ '\n'
+ 'Code objects represent *byte-compiled* executable Python code, or\n'
+ '*bytecode*. The difference between a code object and a function '
'object\n'
- ' was compiled with a particular feature enabled: bit "0x2000" '
+ 'is that the function object contains an explicit reference to the\n'
+ 'function’s globals (the module in which it was defined), while a '
+ 'code\n'
+ 'object contains no context; also the default argument values are\n'
+ 'stored in the function object, not in the code object (because '
+ 'they\n'
+ 'represent values calculated at run-time). Unlike function '
+ 'objects,\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'
- ' set if the function was compiled with future division '
- 'enabled;\n'
- ' bits "0x10" and "0x1000" were used in earlier versions of\n'
- ' Python.\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'
- ' Other bits in "co_flags" are reserved for internal use.\n'
+ 'The following flag bits are defined for "co_flags": bit "0x04" is '
+ 'set\n'
+ 'if the function uses the "*arguments" syntax to accept an '
+ 'arbitrary\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'
+ '\n'
+ 'Future feature declarations ("from __future__ import division") '
+ 'also\n'
+ 'use bits in "co_flags" to indicate whether a code object was '
+ 'compiled\n'
+ 'with a particular feature enabled: bit "0x2000" is set if the '
+ 'function\n'
+ 'was compiled with future division enabled; bits "0x10" and '
+ '"0x1000"\n'
+ 'were used in earlier versions of Python.\n'
'\n'
- ' If a code object represents a function, the first item in\n'
- ' "co_consts" is the documentation string of the function, or\n'
- ' "None" if undefined.\n'
+ 'Other bits in "co_flags" are reserved for internal use.\n'
'\n'
- ' codeobject.co_positions()\n'
+ 'If a code object represents a function, the first item in '
+ '"co_consts"\n'
+ 'is the documentation string of the function, or "None" if '
+ 'undefined.\n'
'\n'
- ' Returns an iterable over the source code positions of '
- 'each\n'
- ' bytecode instruction in the code object.\n'
+ 'codeobject.co_positions()\n'
'\n'
- ' The iterator returns tuples containing the "(start_line,\n'
- ' end_line, start_column, end_column)". The *i-th* tuple\n'
- ' corresponds to the position of the source code that '
- 'compiled\n'
- ' to the *i-th* instruction. Column information is '
- '0-indexed\n'
- ' utf-8 byte offsets on the given source line.\n'
+ ' Returns an iterable over the source code positions of each '
+ 'bytecode\n'
+ ' instruction in the code object.\n'
'\n'
- ' This positional information can be missing. A '
- 'non-exhaustive\n'
- ' lists of cases where this may happen:\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'
+ ' instruction. Column information is 0-indexed utf-8 byte offsets '
+ 'on\n'
+ ' the given source line.\n'
'\n'
- ' * Running the interpreter with "-X" "no_debug_ranges".\n'
+ ' This positional information can be missing. A non-exhaustive '
+ 'lists\n'
+ ' of cases where this may happen:\n'
'\n'
- ' * Loading a pyc file compiled while using "-X"\n'
- ' "no_debug_ranges".\n'
+ ' * Running the interpreter with "-X" "no_debug_ranges".\n'
'\n'
- ' * Position tuples corresponding to artificial '
- 'instructions.\n'
+ ' * Loading a pyc file compiled while using "-X" '
+ '"no_debug_ranges".\n'
'\n'
- ' * Line and column numbers that can’t be represented due '
- 'to\n'
- ' implementation specific limitations.\n'
+ ' * Position tuples corresponding to artificial instructions.\n'
'\n'
- ' When this occurs, some or all of the tuple elements can '
- 'be\n'
- ' "None".\n'
+ ' * Line and column numbers that can’t be represented due to\n'
+ ' implementation specific limitations.\n'
'\n'
- ' New in version 3.11.\n'
+ ' When this occurs, some or all of the tuple elements can be '
+ '"None".\n'
'\n'
- ' Note:\n'
+ ' New in version 3.11.\n'
'\n'
- ' This feature requires storing column positions in code\n'
- ' objects which may result in a small increase of disk '
- 'usage\n'
- ' of compiled Python files or interpreter memory usage. '
- 'To\n'
- ' avoid storing the extra information and/or deactivate\n'
- ' printing the extra traceback information, the "-X"\n'
- ' "no_debug_ranges" command line flag or the\n'
- ' "PYTHONNODEBUGRANGES" environment variable can be used.\n'
+ ' Note:\n'
'\n'
- ' Frame objects\n'
- ' Frame objects represent execution frames. They may occur in\n'
- ' traceback objects (see below), and are also passed to '
- 'registered\n'
- ' trace functions.\n'
+ ' This feature requires storing column positions in code '
+ 'objects\n'
+ ' which may result in a small increase of disk usage of '
+ 'compiled\n'
+ ' Python files or interpreter memory usage. To avoid storing '
+ 'the\n'
+ ' extra information and/or deactivate printing the extra '
+ 'traceback\n'
+ ' information, the "-X" "no_debug_ranges" command line flag or '
+ 'the\n'
+ ' "PYTHONNODEBUGRANGES" environment variable can be used.\n'
+ '\n'
+ '\n'
+ 'Frame objects\n'
+ '-------------\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'
+ '\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'
+ '\n'
+ 'Accessing "f_code" raises an auditing event "object.__getattr__" '
+ 'with\n'
+ 'arguments "obj" and ""f_code"".\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\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'
- ' Special read-only attributes: "f_back" is to the previous '
- 'stack\n'
- ' frame (towards the caller), or "None" if this is the bottom\n'
- ' stack frame; "f_code" is the code object being executed in '
+ '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'
- ' frame; "f_locals" is the dictionary used to look up local\n'
- ' variables; "f_globals" is used for global variables;\n'
- ' "f_builtins" is used for built-in (intrinsic) names; '
- '"f_lasti"\n'
- ' gives the precise instruction (this is an index into the\n'
- ' bytecode string of the code object).\n'
- '\n'
- ' Accessing "f_code" raises an auditing event '
- '"object.__getattr__"\n'
- ' with arguments "obj" and ""f_code"".\n'
- '\n'
- ' Special writable attributes: "f_trace", if not "None", is a\n'
- ' function called for various events during code execution '
- '(this\n'
- ' is used by the debugger). Normally an event is triggered for\n'
- ' each new source line - this can be disabled by setting\n'
- ' "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\n'
- ' trace function escape to the function being traced.\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'
'\n'
- ' "f_lineno" is the current line number of the frame — writing '
- 'to\n'
- ' this from within a trace function jumps to the given line '
- '(only\n'
- ' for the bottom-most frame). A debugger can implement a Jump\n'
- ' command (aka Set Next Statement) by writing to f_lineno.\n'
+ 'Frame objects support one method:\n'
'\n'
- ' Frame objects support one method:\n'
+ 'frame.clear()\n'
'\n'
- ' frame.clear()\n'
+ ' This method clears all references to local variables held by '
+ 'the\n'
+ ' frame. Also, if the frame belonged to a generator, the '
+ 'generator\n'
+ ' is finalized. This helps break reference cycles involving '
+ 'frame\n'
+ ' objects (for example when catching an exception and storing its\n'
+ ' traceback for later use).\n'
'\n'
- ' This method clears all references to local variables held '
- 'by\n'
- ' the frame. Also, if the frame belonged to a generator, '
+ ' "RuntimeError" is raised if the frame is currently executing.\n'
+ '\n'
+ ' New in version 3.4.\n'
+ '\n'
+ '\n'
+ 'Traceback objects\n'
+ '-----------------\n'
+ '\n'
+ 'Traceback objects represent a 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'
+ 'For implicitly created tracebacks, when the search for an '
+ 'exception\n'
+ 'handler unwinds the execution stack, at each unwound level a '
+ 'traceback\n'
+ 'object is inserted in front of the current traceback. When an\n'
+ 'exception handler is entered, the stack trace is made available to '
'the\n'
- ' generator is finalized. This helps break reference '
- 'cycles\n'
- ' involving frame objects (for example when catching an\n'
- ' exception and storing its traceback for later use).\n'
+ 'program. (See section The try statement.) It is accessible as the\n'
+ 'third item of the tuple returned by "sys.exc_info()", and as the\n'
+ '"__traceback__" attribute of the caught exception.\n'
'\n'
- ' "RuntimeError" is raised if the frame is currently '
- 'executing.\n'
+ 'When the program contains no suitable handler, the stack trace is\n'
+ 'written (nicely formatted) to the standard error stream; if the\n'
+ 'interpreter is interactive, it is also made available to the user '
+ 'as\n'
+ '"sys.last_traceback".\n'
'\n'
- ' New in version 3.4.\n'
+ 'For explicitly created tracebacks, it is up to the creator of the\n'
+ 'traceback to determine how the "tb_next" attributes should be '
+ 'linked\n'
+ 'to form a full stack trace.\n'
'\n'
- ' Traceback objects\n'
- ' Traceback objects represent a stack trace of an exception. '
- 'A\n'
- ' traceback object is implicitly created when an exception '
- 'occurs,\n'
- ' and may also be explicitly created by calling\n'
- ' "types.TracebackType".\n'
- '\n'
- ' For implicitly created tracebacks, when the search for an\n'
- ' exception handler unwinds the execution stack, at each '
- 'unwound\n'
- ' level a traceback object is inserted in front of the current\n'
- ' traceback. When an exception handler is entered, the stack\n'
- ' trace is made available to the program. (See section The try\n'
- ' statement.) It is accessible as the third item of the tuple\n'
- ' returned by "sys.exc_info()", and as the "__traceback__"\n'
- ' attribute of the caught exception.\n'
- '\n'
- ' When the program contains no suitable handler, the stack '
- 'trace\n'
- ' is written (nicely formatted) to the standard error stream; '
- 'if\n'
- ' the interpreter is interactive, it is also made available to '
+ '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 '
'the\n'
- ' user as "sys.last_traceback".\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'
- ' For explicitly created tracebacks, it is up to the creator '
- 'of\n'
- ' the traceback to determine how the "tb_next" attributes '
- 'should\n'
- ' be linked to form a full stack trace.\n'
- '\n'
- ' Special read-only attributes: "tb_frame" points to the '
- 'execution\n'
- ' frame of the current level; "tb_lineno" gives the line '
- 'number\n'
- ' where the exception occurred; "tb_lasti" indicates the '
- 'precise\n'
- ' instruction. The line number and last instruction in the\n'
- ' traceback may differ from the line number of its frame object '
+ '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'
- ' the exception occurred in a "try" statement with no matching\n'
- ' except clause or with a finally clause.\n'
+ 'there is no next level.\n'
'\n'
- ' Accessing "tb_frame" raises an auditing event\n'
- ' "object.__getattr__" with arguments "obj" and ""tb_frame"".\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'
'\n'
- ' Special writable attribute: "tb_next" is the next level in '
- 'the\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\n'
- ' existing instances can be updated.\n'
+ 'Slice objects\n'
+ '-------------\n'
'\n'
- ' Slice objects\n'
- ' Slice objects are used to represent slices for '
- '"__getitem__()"\n'
- ' methods. They are also created by the built-in "slice()"\n'
- ' function.\n'
+ 'Slice objects are used to represent slices for "__getitem__()"\n'
+ 'methods. They are also created by the built-in "slice()" '
+ 'function.\n'
'\n'
- ' Special read-only attributes: "start" is the lower bound; '
- '"stop"\n'
- ' is the upper bound; "step" is the step value; each is "None" '
- 'if\n'
- ' omitted. These attributes can have any type.\n'
+ 'Special read-only attributes: "start" is the lower bound; "stop" '
+ 'is\n'
+ 'the upper bound; "step" is the step value; each is "None" if '
+ 'omitted.\n'
+ 'These attributes can have any type.\n'
'\n'
- ' Slice objects support one method:\n'
+ 'Slice objects support one method:\n'
'\n'
- ' slice.indices(self, length)\n'
+ 'slice.indices(self, length)\n'
'\n'
- ' This method takes a single integer argument *length* and\n'
- ' computes information about the slice that the slice '
- 'object\n'
- ' would describe if applied to a sequence of *length* '
- 'items.\n'
- ' It returns a tuple of three integers; respectively these '
- 'are\n'
- ' the *start* and *stop* indices and the *step* or stride\n'
- ' length of the slice. Missing or out-of-bounds indices are\n'
- ' handled in a manner consistent with regular slices.\n'
- '\n'
- ' Static method objects\n'
- ' Static method objects provide a way of defeating the\n'
- ' transformation of function objects to method objects '
- 'described\n'
- ' above. A static method object is a wrapper around any other\n'
- ' object, usually a user-defined method object. When a static\n'
- ' method object is retrieved from a class or a class instance, '
- 'the\n'
- ' object actually returned is the wrapped object, which is not\n'
- ' subject to any further transformation. Static method objects '
- 'are\n'
- ' also callable. Static method objects are created by the '
- 'built-in\n'
- ' "staticmethod()" constructor.\n'
+ ' This method takes a single integer argument *length* and '
+ 'computes\n'
+ ' information about the slice that the slice object would describe '
+ 'if\n'
+ ' applied to a sequence of *length* items. It returns a tuple of\n'
+ ' three integers; respectively these are the *start* and *stop*\n'
+ ' indices and the *step* or stride length of the slice. Missing '
+ 'or\n'
+ ' out-of-bounds indices are handled in a manner consistent with\n'
+ ' regular slices.\n'
'\n'
- ' Class method objects\n'
- ' A class method object, like a static method object, is a '
- 'wrapper\n'
- ' around another object that alters the way in which that '
- 'object\n'
- ' is retrieved from classes and class instances. The behaviour '
+ '\n'
+ 'Static method objects\n'
+ '---------------------\n'
+ '\n'
+ 'Static method objects provide a way of defeating the transformation '
'of\n'
- ' class method objects upon such retrieval is described above,\n'
- ' under “User-defined methods”. Class method objects are '
- 'created\n'
- ' by the built-in "classmethod()" constructor.\n',
+ 'function objects to method objects described above. A static '
+ 'method\n'
+ 'object is a wrapper around any other object, usually a '
+ 'user-defined\n'
+ 'method object. When a static method object is retrieved from a '
+ 'class\n'
+ 'or a class instance, the object actually returned is the wrapped\n'
+ 'object, which is not subject to any further transformation. Static\n'
+ 'method objects are also callable. Static method objects are created '
+ 'by\n'
+ 'the built-in "staticmethod()" constructor.\n'
+ '\n'
+ '\n'
+ 'Class method objects\n'
+ '--------------------\n'
+ '\n'
+ 'A class method object, like a static method object, is a wrapper\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'
+ '"classmethod()" constructor.\n',
'typesfunctions': 'Functions\n'
'*********\n'
'\n'