summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/pydoc_data/topics.py446
1 files changed, 259 insertions, 187 deletions
diff --git a/Lib/pydoc_data/topics.py b/Lib/pydoc_data/topics.py
index f3ceaad..52a3ee1 100644
--- a/Lib/pydoc_data/topics.py
+++ b/Lib/pydoc_data/topics.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# Autogenerated by Sphinx on Fri May 6 23:53:34 2022
+# Autogenerated by Sphinx on Tue Oct 25 00:07:40 2022
topics = {'assert': 'The "assert" statement\n'
'**********************\n'
'\n'
@@ -1671,10 +1671,26 @@ topics = {'assert': 'The "assert" statement\n'
'If the syntax "**expression" appears in the function call,\n'
'"expression" must evaluate to a *mapping*, the contents of which '
'are\n'
- 'treated as additional keyword arguments. If a keyword is already\n'
- 'present (as an explicit keyword argument, or from another '
- 'unpacking),\n'
- 'a "TypeError" exception is raised.\n'
+ 'treated as additional keyword arguments. If a parameter matching a '
+ 'key\n'
+ 'has already been given a value (by an explicit keyword argument, '
+ 'or\n'
+ 'from another unpacking), a "TypeError" exception is raised.\n'
+ '\n'
+ 'When "**expression" is used, each key in this mapping must be a\n'
+ 'string. Each value from the mapping is assigned to the first '
+ 'formal\n'
+ 'parameter eligible for keyword assignment whose name is equal to '
+ 'the\n'
+ 'key. A key need not be a Python identifier (e.g. ""max-temp °F"" '
+ 'is\n'
+ 'acceptable, although it will not match any formal parameter that '
+ 'could\n'
+ 'be declared). If there is no match to a formal parameter the '
+ 'key-value\n'
+ 'pair is collected by the "**" parameter, if there is one, or if '
+ 'there\n'
+ 'is not, a "TypeError" exception is raised.\n'
'\n'
'Formal parameters using the syntax "*identifier" or "**identifier"\n'
'cannot be used as positional argument slots or as keyword argument\n'
@@ -2022,7 +2038,7 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'* Mappings (instances of "dict") compare equal if and only if '
'they\n'
- ' have equal *(key, value)* pairs. Equality comparison of the '
+ ' have equal "(key, value)" pairs. Equality comparison of the '
'keys and\n'
' values enforces reflexivity.\n'
'\n'
@@ -2398,35 +2414,43 @@ topics = {'assert': 'The "assert" statement\n'
' try3_stmt ::= "try" ":" suite\n'
' "finally" ":" suite\n'
'\n'
+ 'Additional information on exceptions can be found in section\n'
+ 'Exceptions, and information on using the "raise" statement to '
+ 'generate\n'
+ 'exceptions may be found in section The raise statement.\n'
+ '\n'
+ '\n'
+ '"except" clause\n'
+ '---------------\n'
+ '\n'
'The "except" clause(s) specify one or more exception handlers. '
'When no\n'
'exception occurs in the "try" clause, no exception handler is\n'
'executed. When an exception occurs in the "try" suite, a search '
'for an\n'
- 'exception handler is started. This search inspects the except '
- 'clauses\n'
- 'in turn until one is found that matches the exception. An '
- 'expression-\n'
- 'less except clause, if present, must be last; it matches any\n'
- 'exception. For an except clause with an expression, that '
- 'expression\n'
- 'is evaluated, and the clause matches the exception if the '
- 'resulting\n'
- 'object is “compatible” with the exception. An object is '
- 'compatible\n'
- 'with an exception if the object is the class or a *non-virtual '
- 'base\n'
- 'class* of the exception object, or a tuple containing an item '
- 'that is\n'
- 'the class or a non-virtual base class of the exception object.\n'
- '\n'
- 'If no except clause matches the exception, the search for an '
+ 'exception handler is started. This search inspects the "except"\n'
+ 'clauses in turn until one is found that matches the exception. '
+ 'An\n'
+ 'expression-less "except" clause, if present, must be last; it '
+ 'matches\n'
+ 'any exception. For an "except" clause with an expression, that\n'
+ 'expression is evaluated, and the clause matches the exception if '
+ 'the\n'
+ 'resulting object is “compatible” with the exception. An object '
+ 'is\n'
+ 'compatible with an exception if the object is the class or a '
+ '*non-\n'
+ 'virtual base class* of the exception object, or a tuple '
+ 'containing an\n'
+ 'item that is the class or a non-virtual base class of the '
'exception\n'
- 'handler continues in the surrounding code and on the invocation '
- 'stack.\n'
- '[1]\n'
+ 'object.\n'
+ '\n'
+ 'If no "except" clause matches the exception, the search for an\n'
+ 'exception handler continues in the surrounding code and on the\n'
+ 'invocation stack. [1]\n'
'\n'
- 'If the evaluation of an expression in the header of an except '
+ 'If the evaluation of an expression in the header of an "except" '
'clause\n'
'raises an exception, the original search for a handler is '
'canceled and\n'
@@ -2436,24 +2460,24 @@ topics = {'assert': 'The "assert" statement\n'
'raised\n'
'the exception).\n'
'\n'
- 'When a matching except clause is found, the exception is '
+ 'When a matching "except" clause is found, the exception is '
'assigned to\n'
- 'the target specified after the "as" keyword in that except '
- 'clause, if\n'
- 'present, and the except clause’s suite is executed. All except\n'
- 'clauses must have an executable block. When the end of this '
+ 'the target specified after the "as" keyword in that "except" '
+ 'clause,\n'
+ 'if present, and the "except" clause’s suite is executed. All '
+ '"except"\n'
+ 'clauses must have an executable block. When the end of this '
'block is\n'
- 'reached, execution continues normally after the entire try '
- 'statement.\n'
- '(This means that if two nested handlers exist for the same '
- 'exception,\n'
- 'and the exception occurs in the try clause of the inner handler, '
- 'the\n'
- 'outer handler will not handle the exception.)\n'
+ 'reached, execution continues normally after the entire "try"\n'
+ 'statement. (This means that if two nested handlers exist for the '
+ 'same\n'
+ 'exception, and the exception occurs in the "try" clause of the '
+ 'inner\n'
+ 'handler, the outer handler will not handle the exception.)\n'
'\n'
'When an exception has been assigned using "as target", it is '
'cleared\n'
- 'at the end of the except clause. This is as if\n'
+ 'at the end of the "except" clause. This is as if\n'
'\n'
' except E as N:\n'
' foo\n'
@@ -2468,7 +2492,7 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'This means the exception must be assigned to a different name to '
'be\n'
- 'able to refer to it after the except clause. Exceptions are '
+ 'able to refer to it after the "except" clause. Exceptions are '
'cleared\n'
'because with the traceback attached to them, they form a '
'reference\n'
@@ -2476,7 +2500,8 @@ topics = {'assert': 'The "assert" statement\n'
'alive\n'
'until the next garbage collection occurs.\n'
'\n'
- 'Before an except clause’s suite is executed, details about the\n'
+ 'Before an "except" clause’s suite is executed, details about '
+ 'the\n'
'exception are stored in the "sys" module and can be accessed '
'via\n'
'"sys.exc_info()". "sys.exc_info()" returns a 3-tuple consisting '
@@ -2512,6 +2537,10 @@ topics = {'assert': 'The "assert" statement\n'
' >>> print(sys.exc_info())\n'
' (None, None, None)\n'
'\n'
+ '\n'
+ '"except*" clause\n'
+ '----------------\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 '
@@ -2520,13 +2549,15 @@ topics = {'assert': 'The "assert" statement\n'
'when\n'
'the type matches some of the exceptions in the group. This means '
'that\n'
- 'multiple except* clauses can execute, each handling part of the\n'
- 'exception group. Each clause executes once and handles an '
- 'exception\n'
- 'group of all matching exceptions. Each exception in the group '
- 'is\n'
- 'handled by at most one except* clause, the first that matches '
- 'it.\n'
+ 'multiple "except*" clauses can execute, each handling part of '
+ 'the\n'
+ 'exception group. Each clause executes at most once and handles '
+ 'an\n'
+ 'exception group of all matching exceptions. Each exception in '
+ 'the\n'
+ 'group is handled by at most one "except*" clause, the first '
+ 'that\n'
+ 'matches it.\n'
'\n'
' >>> try:\n'
' ... raise ExceptionGroup("eg",\n'
@@ -2548,22 +2579,37 @@ topics = {'assert': 'The "assert" statement\n'
' +-+---------------- 1 ----------------\n'
' | ValueError: 1\n'
' +------------------------------------\n'
- ' >>>\n'
'\n'
- ' Any remaining exceptions that were not handled by any except* '
+ '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'
+ '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'
+ 'If the raised exception is not an exception group and its type '
+ 'matches\n'
+ 'one of the "except*" clauses, it is caught and wrapped by an '
+ 'exception\n'
+ 'group with an empty message string.\n'
+ '\n'
+ ' >>> try:\n'
+ ' ... raise BlockingIOError\n'
+ ' ... except* BlockingIOError as e:\n'
+ ' ... print(repr(e))\n'
+ ' ...\n'
+ " ExceptionGroup('', (BlockingIOError()))\n"
+ '\n'
+ 'An "except*" clause must have a matching type, and this type '
+ 'cannot be\n'
+ 'a subclass of "BaseExceptionGroup". It is not possible to mix '
+ '"except"\n'
+ 'and "except*" in the same "try". "break", "continue" and '
+ '"return"\n'
+ 'cannot appear in an "except*" clause.\n'
+ '\n'
+ '\n'
+ '"else" clause\n'
+ '-------------\n'
'\n'
'The optional "else" clause is executed if the control flow '
'leaves the\n'
@@ -2573,6 +2619,10 @@ topics = {'assert': 'The "assert" statement\n'
'are\n'
'not handled by the preceding "except" clauses.\n'
'\n'
+ '\n'
+ '"finally" clause\n'
+ '----------------\n'
+ '\n'
'If "finally" is present, it specifies a ‘cleanup’ handler. The '
'"try"\n'
'clause is executed, including any "except" and "else" clauses. '
@@ -2626,11 +2676,6 @@ topics = {'assert': 'The "assert" statement\n'
' >>> foo()\n'
" 'finally'\n"
'\n'
- 'Additional information on exceptions can be found in section\n'
- 'Exceptions, and information on using the "raise" statement to '
- 'generate\n'
- 'exceptions may be found in section The raise statement.\n'
- '\n'
'Changed in version 3.8: Prior to Python 3.8, a "continue" '
'statement\n'
'was illegal in the "finally" clause due to a problem with the\n'
@@ -3482,8 +3527,8 @@ topics = {'assert': 'The "assert" statement\n'
' there is matched against the whole object rather than an '
'attribute.\n'
' For example "int(0|1)" matches the value "0", but not the '
- 'values\n'
- ' "0.0" or "False".\n'
+ 'value\n'
+ ' "0.0".\n'
'\n'
'In simple terms "CLS(P1, attr=P2)" matches only if the '
'following\n'
@@ -4144,7 +4189,7 @@ topics = {'assert': 'The "assert" statement\n'
' invoking the superclass’s "__new__()" method using\n'
' "super().__new__(cls[, ...])" with appropriate arguments '
'and then\n'
- ' modifying the newly-created instance as necessary before '
+ ' modifying the newly created instance as necessary before '
'returning\n'
' it.\n'
'\n'
@@ -4547,7 +4592,7 @@ topics = {'assert': 'The "assert" statement\n'
'Python.This is\n'
' intended to provide protection against a '
'denial-of-service caused\n'
- ' by carefully-chosen inputs that exploit the worst '
+ ' by carefully chosen inputs that exploit the worst '
'case\n'
' performance of a dict insertion, O(n^2) complexity. '
'See\n'
@@ -4861,7 +4906,10 @@ topics = {'assert': 'The "assert" statement\n'
'is\n'
'applied to separating the commands; the input is split at the '
'first\n'
- '";;" pair, even if it is in the middle of a quoted string.\n'
+ '";;" pair, even if it is in the middle of a quoted string. A\n'
+ 'workaround for strings with double semicolons is to use '
+ 'implicit\n'
+ 'string concatenation "\';\'\';\'" or "";"";"".\n'
'\n'
'If a file ".pdbrc" exists in the user’s home directory or in '
'the\n'
@@ -5537,9 +5585,10 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
' * "for" loop header,\n'
'\n'
- ' * after "as" in a "with" statement, "except" clause or in the '
- 'as-\n'
- ' pattern in structural pattern matching,\n'
+ ' * after "as" in a "with" statement, "except" clause, '
+ '"except*"\n'
+ ' clause, or in the as-pattern in structural pattern '
+ 'matching,\n'
'\n'
' * in a capture pattern in structural pattern matching\n'
'\n'
@@ -7100,8 +7149,8 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'A non-normative HTML file listing all valid identifier '
'characters for\n'
- 'Unicode 14.0.0 can be found at\n'
- 'https://www.unicode.org/Public/14.0.0/ucd/DerivedCoreProperties.txt\n'
+ 'Unicode 15.0.0 can be found at\n'
+ 'https://www.unicode.org/Public/15.0.0/ucd/DerivedCoreProperties.txt\n'
'\n'
'\n'
'Keywords\n'
@@ -7654,9 +7703,8 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
' * "for" loop header,\n'
'\n'
- ' * after "as" in a "with" statement, "except" clause or in the '
- 'as-\n'
- ' pattern in structural pattern matching,\n'
+ ' * after "as" in a "with" statement, "except" clause, "except*"\n'
+ ' clause, or in the as-pattern in structural pattern matching,\n'
'\n'
' * in a capture pattern in structural pattern matching\n'
'\n'
@@ -8229,8 +8277,9 @@ topics = {'assert': 'The "assert" statement\n'
'the syntax is explicitly given, operators are binary. '
'Operators in\n'
'the same box group left to right (except for '
- 'exponentiation, which\n'
- 'groups from right to left).\n'
+ 'exponentiation and\n'
+ 'conditional expressions, which group from right to '
+ 'left).\n'
'\n'
'Note that comparisons, membership tests, and identity '
'tests, all have\n'
@@ -8254,7 +8303,7 @@ topics = {'assert': 'The "assert" statement\n'
'| "x(arguments...)", "x.attribute" | '
'attribute reference |\n'
'+-------------------------------------------------+---------------------------------------+\n'
- '| "await" "x" | '
+ '| "await x" | '
'Await expression |\n'
'+-------------------------------------------------+---------------------------------------+\n'
'| "**" | '
@@ -8290,7 +8339,7 @@ topics = {'assert': 'The "assert" statement\n'
'| ">=", "!=", "==" | '
'tests and identity tests |\n'
'+-------------------------------------------------+---------------------------------------+\n'
- '| "not" "x" | '
+ '| "not x" | '
'Boolean NOT |\n'
'+-------------------------------------------------+---------------------------------------+\n'
'| "and" | '
@@ -8980,31 +9029,7 @@ topics = {'assert': 'The "assert" statement\n'
' still alive. The list is in definition order. Example:\n'
'\n'
' >>> int.__subclasses__()\n'
- " [<class 'bool'>]\n"
- '\n'
- '-[ Footnotes ]-\n'
- '\n'
- '[1] Additional information on these special methods may be '
- 'found in\n'
- ' the Python Reference Manual (Basic customization).\n'
- '\n'
- '[2] As a consequence, the list "[1, 2]" is considered equal '
- 'to "[1.0,\n'
- ' 2.0]", and similarly for tuples.\n'
- '\n'
- '[3] They must have since the parser can’t tell the type of '
- 'the\n'
- ' operands.\n'
- '\n'
- '[4] Cased characters are those with general category '
- 'property being\n'
- ' one of “Lu” (Letter, uppercase), “Ll” (Letter, '
- 'lowercase), or “Lt”\n'
- ' (Letter, titlecase).\n'
- '\n'
- '[5] To format only a tuple you should therefore provide a '
- 'singleton\n'
- ' tuple whose only element is the tuple to be formatted.\n',
+ " [<class 'bool'>]\n",
'specialnames': 'Special method names\n'
'********************\n'
'\n'
@@ -9073,7 +9098,7 @@ topics = {'assert': 'The "assert" statement\n'
' invoking the superclass’s "__new__()" method using\n'
' "super().__new__(cls[, ...])" with appropriate arguments '
'and then\n'
- ' modifying the newly-created instance as necessary before '
+ ' modifying the newly created instance as necessary before '
'returning\n'
' it.\n'
'\n'
@@ -9474,7 +9499,7 @@ topics = {'assert': 'The "assert" statement\n'
'is\n'
' intended to provide protection against a '
'denial-of-service caused\n'
- ' by carefully-chosen inputs that exploit the worst case\n'
+ ' by carefully chosen inputs that exploit the worst case\n'
' performance of a dict insertion, O(n^2) complexity. '
'See\n'
' http://www.ocert.org/advisories/ocert-2011-003.html '
@@ -12191,12 +12216,15 @@ topics = {'assert': 'The "assert" statement\n'
'single quotes ("\'") or double quotes ("""). They can also be '
'enclosed\n'
'in matching groups of three single or double quotes (these are\n'
- 'generally referred to as *triple-quoted strings*). The '
- 'backslash\n'
- '("\\") character is used to escape characters that otherwise have '
- 'a\n'
- 'special meaning, such as newline, backslash itself, or the quote\n'
+ 'generally referred to as *triple-quoted strings*). The backslash '
+ '("\\")\n'
+ 'character is used to give special meaning to otherwise ordinary\n'
+ 'characters like "n", which means ‘newline’ when escaped ("\\n"). '
+ 'It can\n'
+ 'also be used to escape characters that otherwise have a special\n'
+ 'meaning, such as newline, backslash itself, or the quote '
'character.\n'
+ 'See escape sequences below for examples.\n'
'\n'
'Bytes literals are always prefixed with "\'b\'" or "\'B\'"; they '
'produce\n'
@@ -12253,8 +12281,8 @@ topics = {'assert': 'The "assert" statement\n'
'| Escape Sequence | Meaning | Notes '
'|\n'
'|===================|===================================|=========|\n'
- '| "\\newline" | Backslash and newline ignored '
- '| |\n'
+ '| "\\"<newline> | Backslash and newline ignored | '
+ '(1) |\n'
'+-------------------+-----------------------------------+---------+\n'
'| "\\\\" | Backslash ("\\") '
'| |\n'
@@ -12287,10 +12315,10 @@ topics = {'assert': 'The "assert" statement\n'
'| |\n'
'+-------------------+-----------------------------------+---------+\n'
'| "\\ooo" | Character with octal value *ooo* | '
- '(1,3) |\n'
+ '(2,4) |\n'
'+-------------------+-----------------------------------+---------+\n'
'| "\\xhh" | Character with hex value *hh* | '
- '(2,3) |\n'
+ '(3,4) |\n'
'+-------------------+-----------------------------------+---------+\n'
'\n'
'Escape sequences only recognized in string literals are:\n'
@@ -12300,24 +12328,36 @@ topics = {'assert': 'The "assert" statement\n'
'|\n'
'|===================|===================================|=========|\n'
'| "\\N{name}" | Character named *name* in the | '
- '(4) |\n'
+ '(5) |\n'
'| | Unicode database | '
'|\n'
'+-------------------+-----------------------------------+---------+\n'
'| "\\uxxxx" | Character with 16-bit hex value | '
- '(5) |\n'
+ '(6) |\n'
'| | *xxxx* | '
'|\n'
'+-------------------+-----------------------------------+---------+\n'
'| "\\Uxxxxxxxx" | Character with 32-bit hex value | '
- '(6) |\n'
+ '(7) |\n'
'| | *xxxxxxxx* | '
'|\n'
'+-------------------+-----------------------------------+---------+\n'
'\n'
'Notes:\n'
'\n'
- '1. As in Standard C, up to three octal digits are accepted.\n'
+ '1. A backslash can be added at the end of a line to ignore the\n'
+ ' newline:\n'
+ '\n'
+ " >>> 'This string will not include \\\n"
+ " ... backslashes or newline characters.'\n"
+ " 'This string will not include backslashes or newline "
+ "characters.'\n"
+ '\n'
+ ' The same result can be achieved using triple-quoted strings, '
+ 'or\n'
+ ' parentheses and string literal concatenation.\n'
+ '\n'
+ '2. As in Standard C, up to three octal digits are accepted.\n'
'\n'
' Changed in version 3.11: Octal escapes with value larger than\n'
' "0o377" produce a "DeprecationWarning". In a future Python '
@@ -12325,20 +12365,20 @@ topics = {'assert': 'The "assert" statement\n'
' they will be a "SyntaxWarning" and eventually a '
'"SyntaxError".\n'
'\n'
- '2. Unlike in Standard C, exactly two hex digits are required.\n'
+ '3. Unlike in Standard C, exactly two hex digits are required.\n'
'\n'
- '3. In a bytes literal, hexadecimal and octal escapes denote the '
+ '4. In a bytes literal, hexadecimal and octal escapes denote the '
'byte\n'
' with the given value. In a string literal, these escapes '
'denote a\n'
' Unicode character with the given value.\n'
'\n'
- '4. Changed in version 3.3: Support for name aliases [1] has been\n'
+ '5. Changed in version 3.3: Support for name aliases [1] has been\n'
' added.\n'
'\n'
- '5. Exactly four hex digits are required.\n'
+ '6. Exactly four hex digits are required.\n'
'\n'
- '6. Any Unicode character can be encoded this way. Exactly eight '
+ '7. Any Unicode character can be encoded this way. Exactly eight '
'hex\n'
' digits are required.\n'
'\n'
@@ -12509,31 +12549,39 @@ topics = {'assert': 'The "assert" statement\n'
' try3_stmt ::= "try" ":" suite\n'
' "finally" ":" suite\n'
'\n'
+ 'Additional information on exceptions can be found in section\n'
+ 'Exceptions, and information on using the "raise" statement to '
+ 'generate\n'
+ 'exceptions may be found in section The raise statement.\n'
+ '\n'
+ '\n'
+ '"except" clause\n'
+ '===============\n'
+ '\n'
'The "except" clause(s) specify one or more exception handlers. When '
'no\n'
'exception occurs in the "try" clause, no exception handler is\n'
'executed. When an exception occurs in the "try" suite, a search for '
'an\n'
- 'exception handler is started. This search inspects the except '
- 'clauses\n'
- 'in turn until one is found that matches the exception. An '
- 'expression-\n'
- 'less except clause, if present, must be last; it matches any\n'
- 'exception. For an except clause with an expression, that expression\n'
- 'is evaluated, and the clause matches the exception if the resulting\n'
- 'object is “compatible” with the exception. An object is compatible\n'
- 'with an exception if the object is the class or a *non-virtual base\n'
- 'class* of the exception object, or a tuple containing an item that '
- 'is\n'
- 'the class or a non-virtual base class of the exception object.\n'
+ 'exception handler is started. This search inspects the "except"\n'
+ 'clauses in turn until one is found that matches the exception. An\n'
+ 'expression-less "except" clause, if present, must be last; it '
+ 'matches\n'
+ 'any exception. For an "except" clause with an expression, that\n'
+ 'expression is evaluated, and the clause matches the exception if the\n'
+ 'resulting object is “compatible” with the exception. An object is\n'
+ 'compatible with an exception if the object is the class or a *non-\n'
+ 'virtual base class* of the exception object, or a tuple containing '
+ 'an\n'
+ 'item that is the class or a non-virtual base class of the exception\n'
+ 'object.\n'
'\n'
- 'If no except clause matches the exception, the search for an '
- 'exception\n'
- 'handler continues in the surrounding code and on the invocation '
- 'stack.\n'
- '[1]\n'
+ 'If no "except" clause matches the exception, the search for an\n'
+ 'exception handler continues in the surrounding code and on the\n'
+ 'invocation stack. [1]\n'
'\n'
- 'If the evaluation of an expression in the header of an except clause\n'
+ 'If the evaluation of an expression in the header of an "except" '
+ 'clause\n'
'raises an exception, the original search for a handler is canceled '
'and\n'
'a search starts for the new exception in the surrounding code and on\n'
@@ -12541,21 +12589,20 @@ topics = {'assert': 'The "assert" statement\n'
'raised\n'
'the exception).\n'
'\n'
- 'When a matching except clause is found, the exception is assigned to\n'
- 'the target specified after the "as" keyword in that except clause, '
- 'if\n'
- 'present, and the except clause’s suite is executed. All except\n'
- 'clauses must have an executable block. When the end of this block '
- 'is\n'
- 'reached, execution continues normally after the entire try '
- 'statement.\n'
- '(This means that if two nested handlers exist for the same '
- 'exception,\n'
- 'and the exception occurs in the try clause of the inner handler, the\n'
- 'outer handler will not handle the exception.)\n'
+ 'When a matching "except" clause is found, the exception is assigned '
+ 'to\n'
+ 'the target specified after the "as" keyword in that "except" clause,\n'
+ 'if present, and the "except" clause’s suite is executed. All '
+ '"except"\n'
+ 'clauses must have an executable block. When the end of this block is\n'
+ 'reached, execution continues normally after the entire "try"\n'
+ 'statement. (This means that if two nested handlers exist for the '
+ 'same\n'
+ 'exception, and the exception occurs in the "try" clause of the inner\n'
+ 'handler, the outer handler will not handle the exception.)\n'
'\n'
'When an exception has been assigned using "as target", it is cleared\n'
- 'at the end of the except clause. This is as if\n'
+ 'at the end of the "except" clause. This is as if\n'
'\n'
' except E as N:\n'
' foo\n'
@@ -12569,12 +12616,13 @@ topics = {'assert': 'The "assert" statement\n'
' del N\n'
'\n'
'This means the exception must be assigned to a different name to be\n'
- 'able to refer to it after the except clause. Exceptions are cleared\n'
+ 'able to refer to it after the "except" clause. Exceptions are '
+ 'cleared\n'
'because with the traceback attached to them, they form a reference\n'
'cycle with the stack frame, keeping all locals in that frame alive\n'
'until the next garbage collection occurs.\n'
'\n'
- 'Before an except clause’s suite is executed, details about the\n'
+ 'Before an "except" clause’s suite is executed, details about the\n'
'exception are stored in the "sys" module and can be accessed via\n'
'"sys.exc_info()". "sys.exc_info()" returns a 3-tuple consisting of '
'the\n'
@@ -12606,16 +12654,21 @@ topics = {'assert': 'The "assert" statement\n'
' >>> print(sys.exc_info())\n'
' (None, None, None)\n'
'\n'
+ '\n'
+ '"except*" clause\n'
+ '================\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 '
'"except",\n'
'but in the case of exception groups we can have partial matches when\n'
'the type matches some of the exceptions in the group. This means '
'that\n'
- 'multiple except* clauses can execute, each handling part of the\n'
- 'exception group. Each clause executes once and handles an exception\n'
- 'group of all matching exceptions. Each exception in the group is\n'
- 'handled by at most one except* clause, the first that matches it.\n'
+ 'multiple "except*" clauses can execute, each handling part of the\n'
+ 'exception group. Each clause executes at most once and handles an\n'
+ 'exception group of all matching exceptions. Each exception in the\n'
+ 'group is handled by at most one "except*" clause, the first that\n'
+ 'matches it.\n'
'\n'
' >>> try:\n'
' ... raise ExceptionGroup("eg",\n'
@@ -12635,22 +12688,36 @@ topics = {'assert': 'The "assert" statement\n'
' +-+---------------- 1 ----------------\n'
' | ValueError: 1\n'
' +------------------------------------\n'
- ' >>>\n'
'\n'
- ' Any remaining exceptions that were not handled by any except* '
+ 'Any remaining exceptions that were not handled by any "except*" '
'clause\n'
- ' are re-raised at the end, combined into an exception group along '
+ 'are re-raised at the end, combined into an exception group along '
'with\n'
- ' all exceptions that were raised from within except* clauses.\n'
+ 'all exceptions that were raised from within "except*" clauses.\n'
+ '\n'
+ 'If the raised exception is not an exception group and its type '
+ 'matches\n'
+ 'one of the "except*" clauses, it is caught and wrapped by an '
+ 'exception\n'
+ 'group with an empty message string.\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'
+ ' >>> try:\n'
+ ' ... raise BlockingIOError\n'
+ ' ... except* BlockingIOError as e:\n'
+ ' ... print(repr(e))\n'
+ ' ...\n'
+ " ExceptionGroup('', (BlockingIOError()))\n"
+ '\n'
+ 'An "except*" clause must have a matching type, and this type cannot '
+ 'be\n'
+ 'a subclass of "BaseExceptionGroup". It is not possible to mix '
+ '"except"\n'
+ 'and "except*" in the same "try". "break", "continue" and "return"\n'
+ 'cannot appear in an "except*" clause.\n'
+ '\n'
+ '\n'
+ '"else" clause\n'
+ '=============\n'
'\n'
'The optional "else" clause is executed if the control flow leaves '
'the\n'
@@ -12659,6 +12726,10 @@ topics = {'assert': 'The "assert" statement\n'
'"break" statement was executed. Exceptions in the "else" clause are\n'
'not handled by the preceding "except" clauses.\n'
'\n'
+ '\n'
+ '"finally" clause\n'
+ '================\n'
+ '\n'
'If "finally" is present, it specifies a ‘cleanup’ handler. The '
'"try"\n'
'clause is executed, including any "except" and "else" clauses. If '
@@ -12706,11 +12777,6 @@ topics = {'assert': 'The "assert" statement\n'
' >>> foo()\n'
" 'finally'\n"
'\n'
- 'Additional information on exceptions can be found in section\n'
- 'Exceptions, and information on using the "raise" statement to '
- 'generate\n'
- 'exceptions may be found in section The raise statement.\n'
- '\n'
'Changed in version 3.8: Prior to Python 3.8, a "continue" statement\n'
'was illegal in the "finally" clause due to a problem with the\n'
'implementation.\n',
@@ -12910,7 +12976,7 @@ topics = {'assert': 'The "assert" statement\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'
+ 'char\n'
' type; instead, every code point in the string is '
'represented\n'
' as a string object with length "1". The built-in '
@@ -14336,7 +14402,11 @@ topics = {'assert': 'The "assert" statement\n'
'abstract\n'
'base class "collections.abc.Set" are available (for example, '
'"==",\n'
- '"<", or "^").\n'
+ '"<", or "^"). While using set operators, set-like views '
+ 'accept any\n'
+ 'iterable as the other operand, unlike sets which only accept '
+ 'sets as\n'
+ 'the input.\n'
'\n'
'An example of dictionary view usage:\n'
'\n'
@@ -14370,6 +14440,8 @@ topics = {'assert': 'The "assert" statement\n'
" {'bacon'}\n"
" >>> keys ^ {'sausage', 'juice'}\n"
" {'juice', 'sausage', 'bacon', 'spam'}\n"
+ " >>> keys | ['juice', 'juice', 'juice']\n"
+ " {'juice', 'sausage', 'bacon', 'spam', 'eggs'}\n"
'\n'
' >>> # get back a read-only proxy for the original '
'dictionary\n'