diff options
Diffstat (limited to 'Lib/pydoc_data/topics.py')
-rw-r--r-- | Lib/pydoc_data/topics.py | 238 |
1 files changed, 159 insertions, 79 deletions
diff --git a/Lib/pydoc_data/topics.py b/Lib/pydoc_data/topics.py index e31d2d8de6..5ce0542041 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 Dec 8 22:23:59 2021 +# Autogenerated by Sphinx on Thu Jan 13 19:37:48 2022 topics = {'assert': 'The "assert" statement\n' '**********************\n' '\n' @@ -1142,11 +1142,17 @@ topics = {'assert': 'The "assert" statement\n' ' “variable-length” built-in types such as "int", ' '"bytes" and "tuple".\n' '\n' - '* Any non-string iterable may be assigned to ' - '*__slots__*. Mappings may\n' - ' also be used; however, in the future, special meaning ' - 'may be\n' - ' assigned to the values corresponding to each key.\n' + '* Any non-string *iterable* may be assigned to ' + '*__slots__*.\n' + '\n' + '* If a "dictionary" is used to assign *__slots__*, the ' + 'dictionary keys\n' + ' will be used as the slot names. The values of the ' + 'dictionary can be\n' + ' used to provide per-attribute docstrings that will be ' + 'recognised by\n' + ' "inspect.getdoc()" and displayed in the output of ' + '"help()".\n' '\n' '* "__class__" assignment works only if both classes have ' 'the same\n' @@ -2376,33 +2382,6 @@ topics = {'assert': 'The "assert" statement\n' ':= a to b do"; e.g., "list(range(3))" returns the list "[0, 1, ' '2]".\n' '\n' - 'Note:\n' - '\n' - ' There is a subtlety when the sequence is being modified by the ' - 'loop\n' - ' (this can only occur for mutable sequences, e.g. lists). An\n' - ' internal counter is used to keep track of which item is used ' - 'next,\n' - ' and this is incremented on each iteration. When this counter ' - 'has\n' - ' reached the length of the sequence the loop terminates. This ' - 'means\n' - ' that if the suite deletes the current (or a previous) item ' - 'from the\n' - ' sequence, the next item will be skipped (since it gets the ' - 'index of\n' - ' the current item which has already been treated). Likewise, ' - 'if the\n' - ' suite inserts an item in the sequence before the current item, ' - 'the\n' - ' current item will be treated again the next time through the ' - 'loop.\n' - ' This can lead to nasty bugs that can be avoided by making a\n' - ' temporary copy using a slice of the whole sequence, e.g.,\n' - '\n' - ' for x in a[:]:\n' - ' if x < 0: a.remove(x)\n' - '\n' '\n' 'The "try" statement\n' '===================\n' @@ -2411,13 +2390,18 @@ topics = {'assert': 'The "assert" statement\n' 'code\n' 'for a group of statements:\n' '\n' - ' try_stmt ::= try1_stmt | try2_stmt\n' + ' try_stmt ::= try1_stmt | try2_stmt | try3_stmt\n' ' try1_stmt ::= "try" ":" suite\n' ' ("except" [expression ["as" identifier]] ":" ' 'suite)+\n' ' ["else" ":" suite]\n' ' ["finally" ":" suite]\n' ' try2_stmt ::= "try" ":" suite\n' + ' ("except" "*" expression ["as" identifier] ":" ' + 'suite)+\n' + ' ["else" ":" suite]\n' + ' ["finally" ":" suite]\n' + ' try3_stmt ::= "try" ":" suite\n' ' "finally" ":" suite\n' '\n' 'The "except" clause(s) specify one or more exception handlers. ' @@ -2534,6 +2518,60 @@ topics = {'assert': 'The "assert" statement\n' ' >>> print(sys.exc_info())\n' ' (None, None, None)\n' '\n' + 'The "except*" clause(s) are used for handling "ExceptionGroup`s. ' + 'The\n' + 'exception type for matching is interpreted as in the case of\n' + ':keyword:`except", but in the case of exception groups we can ' + 'have\n' + 'partial matches when the type matches some of the exceptions in ' + 'the\n' + 'group. This means that multiple except* clauses can execute, ' + 'each\n' + 'handling part of the exception group. Each clause executes once ' + 'and\n' + 'handles an exception group of all matching exceptions. Each ' + 'exception\n' + 'in the group is handled by at most one except* clause, the first ' + 'that\n' + 'matches it.\n' + '\n' + ' >>> try:\n' + ' ... raise ExceptionGroup("eg",\n' + ' ... [ValueError(1), TypeError(2), OSError(3), ' + 'OSError(4)])\n' + ' ... except* TypeError as e:\n' + " ... print(f'caught {type(e)} with nested " + "{e.exceptions}')\n" + ' ... except* OSError as e:\n' + " ... print(f'caught {type(e)} with nested " + "{e.exceptions}')\n" + ' ...\n' + " caught <class 'ExceptionGroup'> with nested (TypeError(2),)\n" + " caught <class 'ExceptionGroup'> with nested (OSError(3), " + 'OSError(4))\n' + ' + Exception Group Traceback (most recent call last):\n' + ' | File "<stdin>", line 2, in <module>\n' + ' | ExceptionGroup: eg\n' + ' +-+---------------- 1 ----------------\n' + ' | ValueError: 1\n' + ' +------------------------------------\n' + ' >>>\n' + '\n' + ' Any remaining exceptions that were not handled by any except* ' + 'clause\n' + ' are re-raised at the end, combined into an exception group ' + 'along with\n' + ' all exceptions that were raised from within except* clauses.\n' + '\n' + ' An except* clause must have a matching type, and this type ' + 'cannot be a\n' + ' subclass of :exc:`BaseExceptionGroup`. It is not possible to ' + 'mix except\n' + ' and except* in the same :keyword:`try`. :keyword:`break`,\n' + ' :keyword:`continue` and :keyword:`return` cannot appear in an ' + 'except*\n' + ' clause.\n' + '\n' 'The optional "else" clause is executed if the control flow ' 'leaves the\n' '"try" suite, no exception was raised, and no "return", ' @@ -4620,17 +4658,16 @@ topics = {'assert': 'The "assert" statement\n' 'debugger will pause execution just before the first line of the\n' 'module.\n' '\n' - 'The typical usage to break into the debugger from a running ' - 'program is\n' - 'to insert\n' + 'The typical usage to break into the debugger is to insert:\n' '\n' ' import pdb; pdb.set_trace()\n' '\n' - 'at the location you want to break into the debugger. You can ' - 'then\n' - 'step through the code following this statement, and continue ' - 'running\n' - 'without the debugger using the "continue" command.\n' + 'at the location you want to break into the debugger, and then ' + 'run the\n' + 'program. You can then step through the code following this ' + 'statement,\n' + 'and continue running without the debugger using the "continue"\n' + 'command.\n' '\n' 'New in version 3.7: The built-in "breakpoint()", when called ' 'with\n' @@ -5897,30 +5934,7 @@ topics = {'assert': 'The "assert" statement\n' 'all by the loop. Hint: the built-in function "range()" returns an\n' 'iterator of integers suitable to emulate the effect of Pascal’s "for ' 'i\n' - ':= a to b do"; e.g., "list(range(3))" returns the list "[0, 1, 2]".\n' - '\n' - 'Note:\n' - '\n' - ' There is a subtlety when the sequence is being modified by the ' - 'loop\n' - ' (this can only occur for mutable sequences, e.g. lists). An\n' - ' internal counter is used to keep track of which item is used next,\n' - ' and this is incremented on each iteration. When this counter has\n' - ' reached the length of the sequence the loop terminates. This ' - 'means\n' - ' that if the suite deletes the current (or a previous) item from ' - 'the\n' - ' sequence, the next item will be skipped (since it gets the index ' - 'of\n' - ' the current item which has already been treated). Likewise, if ' - 'the\n' - ' suite inserts an item in the sequence before the current item, the\n' - ' current item will be treated again the next time through the loop.\n' - ' This can lead to nasty bugs that can be avoided by making a\n' - ' temporary copy using a slice of the whole sequence, e.g.,\n' - '\n' - ' for x in a[:]:\n' - ' if x < 0: a.remove(x)\n', + ':= a to b do"; e.g., "list(range(3))" returns the list "[0, 1, 2]".\n', 'formatstrings': 'Format String Syntax\n' '********************\n' '\n' @@ -9934,11 +9948,16 @@ topics = {'assert': 'The "assert" statement\n' ' “variable-length” built-in types such as "int", "bytes" ' 'and "tuple".\n' '\n' - '* Any non-string iterable may be assigned to *__slots__*. ' - 'Mappings may\n' - ' also be used; however, in the future, special meaning may ' - 'be\n' - ' assigned to the values corresponding to each key.\n' + '* Any non-string *iterable* may be assigned to *__slots__*.\n' + '\n' + '* If a "dictionary" is used to assign *__slots__*, the ' + 'dictionary keys\n' + ' will be used as the slot names. The values of the ' + 'dictionary can be\n' + ' used to provide per-attribute docstrings that will be ' + 'recognised by\n' + ' "inspect.getdoc()" and displayed in the output of ' + '"help()".\n' '\n' '* "__class__" assignment works only if both classes have the ' 'same\n' @@ -11504,9 +11523,9 @@ topics = {'assert': 'The "assert" statement\n' ' >>> from keyword import iskeyword\n' '\n' " >>> 'hello'.isidentifier(), iskeyword('hello')\n" - ' True, False\n' + ' (True, False)\n' " >>> 'def'.isidentifier(), iskeyword('def')\n" - ' True, True\n' + ' (True, True)\n' '\n' 'str.islower()\n' '\n' @@ -11857,7 +11876,7 @@ topics = {'assert': 'The "assert" statement\n' " >>> ' 1 2 3 '.split()\n" " ['1', '2', '3']\n" '\n' - 'str.splitlines([keepends])\n' + 'str.splitlines(keepends=False)\n' '\n' ' Return a list of the lines in the string, breaking at ' 'line\n' @@ -12432,13 +12451,18 @@ topics = {'assert': 'The "assert" statement\n' 'The "try" statement specifies exception handlers and/or cleanup code\n' 'for a group of statements:\n' '\n' - ' try_stmt ::= try1_stmt | try2_stmt\n' + ' try_stmt ::= try1_stmt | try2_stmt | try3_stmt\n' ' try1_stmt ::= "try" ":" suite\n' ' ("except" [expression ["as" identifier]] ":" ' 'suite)+\n' ' ["else" ":" suite]\n' ' ["finally" ":" suite]\n' ' try2_stmt ::= "try" ":" suite\n' + ' ("except" "*" expression ["as" identifier] ":" ' + 'suite)+\n' + ' ["else" ":" suite]\n' + ' ["finally" ":" suite]\n' + ' try3_stmt ::= "try" ":" suite\n' ' "finally" ":" suite\n' '\n' 'The "except" clause(s) specify one or more exception handlers. When ' @@ -12538,6 +12562,53 @@ topics = {'assert': 'The "assert" statement\n' ' >>> print(sys.exc_info())\n' ' (None, None, None)\n' '\n' + 'The "except*" clause(s) are used for handling "ExceptionGroup`s. The\n' + 'exception type for matching is interpreted as in the case of\n' + ':keyword:`except", but in the case of exception groups we can have\n' + 'partial matches when the type matches some of the exceptions in the\n' + 'group. This means that multiple except* clauses can execute, each\n' + 'handling part of the exception group. Each clause executes once and\n' + 'handles an exception group of all matching exceptions. Each ' + 'exception\n' + 'in the group is handled by at most one except* clause, the first ' + 'that\n' + 'matches it.\n' + '\n' + ' >>> try:\n' + ' ... raise ExceptionGroup("eg",\n' + ' ... [ValueError(1), TypeError(2), OSError(3), ' + 'OSError(4)])\n' + ' ... except* TypeError as e:\n' + " ... print(f'caught {type(e)} with nested {e.exceptions}')\n" + ' ... except* OSError as e:\n' + " ... print(f'caught {type(e)} with nested {e.exceptions}')\n" + ' ...\n' + " caught <class 'ExceptionGroup'> with nested (TypeError(2),)\n" + " caught <class 'ExceptionGroup'> with nested (OSError(3), " + 'OSError(4))\n' + ' + Exception Group Traceback (most recent call last):\n' + ' | File "<stdin>", line 2, in <module>\n' + ' | ExceptionGroup: eg\n' + ' +-+---------------- 1 ----------------\n' + ' | ValueError: 1\n' + ' +------------------------------------\n' + ' >>>\n' + '\n' + ' Any remaining exceptions that were not handled by any except* ' + 'clause\n' + ' are re-raised at the end, combined into an exception group along ' + 'with\n' + ' all exceptions that were raised from within except* clauses.\n' + '\n' + ' An except* clause must have a matching type, and this type cannot ' + 'be a\n' + ' subclass of :exc:`BaseExceptionGroup`. It is not possible to mix ' + 'except\n' + ' and except* in the same :keyword:`try`. :keyword:`break`,\n' + ' :keyword:`continue` and :keyword:`return` cannot appear in an ' + 'except*\n' + ' clause.\n' + '\n' 'The optional "else" clause is executed if the control flow leaves ' 'the\n' '"try" suite, no exception was raised, and no "return", "continue", ' @@ -13814,9 +13885,9 @@ topics = {'assert': 'The "assert" statement\n' '"dict"\n' 'constructor.\n' '\n' - 'class dict(**kwarg)\n' - 'class dict(mapping, **kwarg)\n' - 'class dict(iterable, **kwarg)\n' + 'class dict(**kwargs)\n' + 'class dict(mapping, **kwargs)\n' + 'class dict(iterable, **kwargs)\n' '\n' ' Return a new dictionary initialized from an optional ' 'positional\n' @@ -14466,6 +14537,14 @@ topics = {'assert': 'The "assert" statement\n' 'Comparisons in\n' 'the language reference.)\n' '\n' + 'Forward and reversed iterators over mutable sequences access ' + 'values\n' + 'using an index. That index will continue to march forward (or\n' + 'backward) even if the underlying sequence is mutated. The ' + 'iterator\n' + 'terminates only when an "IndexError" or a "StopIteration" is\n' + 'encountered (or when the index drops below zero).\n' + '\n' 'Notes:\n' '\n' '1. While the "in" and "not in" operations are used only for ' @@ -14937,7 +15016,8 @@ topics = {'assert': 'The "assert" statement\n' '\n' ' The arguments to the range constructor must be integers ' '(either\n' - ' built-in "int" or any object that implements the "__index__"\n' + ' built-in "int" or any object that implements the ' + '"__index__()"\n' ' special method). If the *step* argument is omitted, it ' 'defaults to\n' ' "1". If the *start* argument is omitted, it defaults to "0". ' |