diff options
author | Ned Deily <nad@python.org> | 2017-09-19 05:01:36 (GMT) |
---|---|---|
committer | Ned Deily <nad@python.org> | 2017-09-19 05:01:36 (GMT) |
commit | 450ceea33169e8a7717d3e2fffb009141a99c479 (patch) | |
tree | c503081df2b528bacc9eb749cc7f29bef19ec294 /Lib/pydoc_data/topics.py | |
parent | 380c5fbc6f9b89e013cd7dbb540316a59e4ddb63 (diff) | |
download | cpython-450ceea33169e8a7717d3e2fffb009141a99c479.zip cpython-450ceea33169e8a7717d3e2fffb009141a99c479.tar.gz cpython-450ceea33169e8a7717d3e2fffb009141a99c479.tar.bz2 |
Update PyDoc topics and NEWS blurbs for 3.7.0a1
Diffstat (limited to 'Lib/pydoc_data/topics.py')
-rw-r--r-- | Lib/pydoc_data/topics.py | 883 |
1 files changed, 461 insertions, 422 deletions
diff --git a/Lib/pydoc_data/topics.py b/Lib/pydoc_data/topics.py index 3579484..8d64ad4 100644 --- a/Lib/pydoc_data/topics.py +++ b/Lib/pydoc_data/topics.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- -# Autogenerated by Sphinx on Mon Sep 12 10:47:11 2016 -topics = {'assert': '\n' - 'The "assert" statement\n' +# Autogenerated by Sphinx on Tue Sep 19 00:59:47 2017 +topics = {'assert': 'The "assert" statement\n' '**********************\n' '\n' 'Assert statements are a convenient way to insert debugging ' @@ -39,8 +38,7 @@ topics = {'assert': '\n' 'Assignments to "__debug__" are illegal. The value for the ' 'built-in\n' 'variable is determined when the interpreter starts.\n', - 'assignment': '\n' - 'Assignment statements\n' + 'assignment': 'Assignment statements\n' '*********************\n' '\n' 'Assignment statements are used to (re)bind names to values and ' @@ -405,8 +403,7 @@ topics = {'assert': '\n' 'See also: **PEP 526** - Variable and attribute annotation ' 'syntax\n' ' **PEP 484** - Type hints\n', - 'atom-identifiers': '\n' - 'Identifiers (Names)\n' + 'atom-identifiers': 'Identifiers (Names)\n' '*******************\n' '\n' 'An identifier occurring as an atom is a name. See ' @@ -446,8 +443,7 @@ topics = {'assert': '\n' 'happen. If the class name consists only of underscores, ' 'no\n' 'transformation is done.\n', - 'atom-literals': '\n' - 'Literals\n' + 'atom-literals': 'Literals\n' '********\n' '\n' 'Python supports string and bytes literals and various ' @@ -476,8 +472,7 @@ topics = {'assert': '\n' 'may obtain\n' 'the same object or a different object with the same ' 'value.\n', - 'attribute-access': '\n' - 'Customizing attribute access\n' + 'attribute-access': 'Customizing attribute access\n' '****************************\n' '\n' 'The following methods can be defined to customize the ' @@ -747,23 +742,15 @@ topics = {'assert': '\n' '__slots__\n' '=========\n' '\n' - 'By default, instances of classes have a dictionary for ' - 'attribute\n' - 'storage. This wastes space for objects having very few ' - 'instance\n' - 'variables. The space consumption can become acute when ' - 'creating large\n' - 'numbers of instances.\n' + '*__slots__* allow us to explicitly declare data members ' + '(like\n' + 'properties) and deny the creation of *__dict__* and ' + '*__weakref__*\n' + '(unless explicitly declared in *__slots__* or available ' + 'in a parent.)\n' '\n' - 'The default can be overridden by defining *__slots__* in ' - 'a class\n' - 'definition. The *__slots__* declaration takes a sequence ' - 'of instance\n' - 'variables and reserves just enough space in each ' - 'instance to hold a\n' - 'value for each variable. Space is saved because ' - '*__dict__* is not\n' - 'created for each instance.\n' + 'The space saved over using *__dict__* can be ' + 'significant.\n' '\n' 'object.__slots__\n' '\n' @@ -783,9 +770,9 @@ topics = {'assert': '\n' '\n' '* When inheriting from a class without *__slots__*, the ' '*__dict__*\n' - ' attribute of that class will always be accessible, so ' - 'a *__slots__*\n' - ' definition in the subclass is meaningless.\n' + ' and *__weakref__* attribute of the instances will ' + 'always be\n' + ' accessible.\n' '\n' '* Without a *__dict__* variable, instances cannot be ' 'assigned new\n' @@ -819,13 +806,16 @@ topics = {'assert': '\n' 'the class\n' ' attribute would overwrite the descriptor assignment.\n' '\n' - '* The action of a *__slots__* declaration is limited to ' - 'the class\n' - ' where it is defined. As a result, subclasses will ' - 'have a *__dict__*\n' - ' unless they also define *__slots__* (which must only ' - 'contain names\n' - ' of any *additional* slots).\n' + '* The action of a *__slots__* declaration is not limited ' + 'to the\n' + ' class where it is defined. *__slots__* declared in ' + 'parents are\n' + ' available in child classes. However, child subclasses ' + 'will get a\n' + ' *__dict__* and *__weakref__* unless they also define ' + '*__slots__*\n' + ' (which should only contain names of any *additional* ' + 'slots).\n' '\n' '* If a class defines a slot also defined in a base ' 'class, the\n' @@ -850,9 +840,16 @@ topics = {'assert': '\n' '\n' '* *__class__* assignment works only if both classes have ' 'the same\n' - ' *__slots__*.\n', - 'attribute-references': '\n' - 'Attribute references\n' + ' *__slots__*.\n' + '\n' + '* Multiple inheritance with multiple slotted parent ' + 'classes can be\n' + ' used, but only one parent is allowed to have ' + 'attributes created by\n' + ' slots (the other bases must have empty slot layouts) - ' + 'violations\n' + ' raise "TypeError".\n', + 'attribute-references': 'Attribute references\n' '********************\n' '\n' 'An attribute reference is a primary followed by a ' @@ -875,8 +872,7 @@ topics = {'assert': '\n' 'determined by the object. Multiple evaluations of ' 'the same attribute\n' 'reference may yield different objects.\n', - 'augassign': '\n' - 'Augmented assignment statements\n' + 'augassign': 'Augmented assignment statements\n' '*******************************\n' '\n' 'Augmented assignment is the combination, in a single statement, ' @@ -940,8 +936,7 @@ topics = {'assert': '\n' 'about\n' 'class and instance attributes applies as for regular ' 'assignments.\n', - 'binary': '\n' - 'Binary arithmetic operations\n' + 'binary': 'Binary arithmetic operations\n' '****************************\n' '\n' 'The binary arithmetic operations have the conventional priority\n' @@ -1029,8 +1024,7 @@ topics = {'assert': '\n' 'The "-" (subtraction) operator yields the difference of its ' 'arguments.\n' 'The numeric arguments are first converted to a common type.\n', - 'bitwise': '\n' - 'Binary bitwise operations\n' + 'bitwise': 'Binary bitwise operations\n' '*************************\n' '\n' 'Each of the three bitwise operations has a different priority ' @@ -1050,8 +1044,7 @@ topics = {'assert': '\n' 'The "|" operator yields the bitwise (inclusive) OR of its ' 'arguments,\n' 'which must be integers.\n', - 'bltin-code-objects': '\n' - 'Code Objects\n' + 'bltin-code-objects': 'Code Objects\n' '************\n' '\n' 'Code objects are used by the implementation to ' @@ -1074,8 +1067,7 @@ topics = {'assert': '\n' '\n' 'See The standard type hierarchy for more ' 'information.\n', - 'bltin-ellipsis-object': '\n' - 'The Ellipsis Object\n' + 'bltin-ellipsis-object': 'The Ellipsis Object\n' '*******************\n' '\n' 'This object is commonly used by slicing (see ' @@ -1087,8 +1079,7 @@ topics = {'assert': '\n' '"Ellipsis" singleton.\n' '\n' 'It is written as "Ellipsis" or "...".\n', - 'bltin-null-object': '\n' - 'The Null Object\n' + 'bltin-null-object': 'The Null Object\n' '***************\n' '\n' "This object is returned by functions that don't " @@ -1100,8 +1091,7 @@ topics = {'assert': '\n' 'same singleton.\n' '\n' 'It is written as "None".\n', - 'bltin-type-objects': '\n' - 'Type Objects\n' + 'bltin-type-objects': 'Type Objects\n' '************\n' '\n' 'Type objects represent the various object types. An ' @@ -1113,8 +1103,7 @@ topics = {'assert': '\n' 'all standard built-in types.\n' '\n' 'Types are written like this: "<class \'int\'>".\n', - 'booleans': '\n' - 'Boolean operations\n' + 'booleans': 'Boolean operations\n' '******************\n' '\n' ' or_test ::= and_test | or_test "or" and_test\n' @@ -1163,8 +1152,7 @@ topics = {'assert': '\n' 'its\n' 'argument (for example, "not \'foo\'" produces "False" rather ' 'than "\'\'".)\n', - 'break': '\n' - 'The "break" statement\n' + 'break': 'The "break" statement\n' '*********************\n' '\n' ' break_stmt ::= "break"\n' @@ -1185,8 +1173,7 @@ topics = {'assert': '\n' 'clause, that "finally" clause is executed before really leaving ' 'the\n' 'loop.\n', - 'callable-types': '\n' - 'Emulating callable objects\n' + 'callable-types': 'Emulating callable objects\n' '**************************\n' '\n' 'object.__call__(self[, args...])\n' @@ -1195,8 +1182,7 @@ topics = {'assert': '\n' 'this method\n' ' is defined, "x(arg1, arg2, ...)" is a shorthand for\n' ' "x.__call__(arg1, arg2, ...)".\n', - 'calls': '\n' - 'Calls\n' + 'calls': 'Calls\n' '*****\n' '\n' 'A call calls a callable object (e.g., a *function*) with a ' @@ -1217,7 +1203,8 @@ topics = {'assert': '\n' ' ("," "*" expression | "," ' 'keyword_item)*\n' ' keywords_arguments ::= (keyword_item | "**" expression)\n' - ' ("," keyword_item | "**" expression)*\n' + ' ("," keyword_item | "," "**" ' + 'expression)*\n' ' keyword_item ::= identifier "=" expression\n' '\n' 'An optional trailing comma may be present after the positional and\n' @@ -1316,7 +1303,7 @@ topics = {'assert': '\n' ' 2 1\n' ' >>> f(a=1, *(2,))\n' ' Traceback (most recent call last):\n' - ' File "<stdin>", line 1, in ?\n' + ' File "<stdin>", line 1, in <module>\n' " TypeError: f() got multiple values for keyword argument 'a'\n" ' >>> f(1, *(2,))\n' ' 1 2\n' @@ -1382,8 +1369,7 @@ topics = {'assert': '\n' ' The class must define a "__call__()" method; the effect is then ' 'the\n' ' same as if that method was called.\n', - 'class': '\n' - 'Class definitions\n' + 'class': 'Class definitions\n' '*****************\n' '\n' 'A class definition defines a class object (see section The ' @@ -1469,8 +1455,7 @@ topics = {'assert': '\n' '\n' 'See also: **PEP 3115** - Metaclasses in Python 3 **PEP 3129** -\n' ' Class Decorators\n', - 'comparisons': '\n' - 'Comparisons\n' + 'comparisons': 'Comparisons\n' '***********\n' '\n' 'Unlike C, all comparison operations in Python have the same ' @@ -1623,7 +1608,7 @@ topics = {'assert': '\n' 'restriction that\n' ' ranges do not support order comparison. Equality ' 'comparison across\n' - ' these types results in unequality, and ordering comparison ' + ' these types results in inequality, and ordering comparison ' 'across\n' ' these types raises "TypeError".\n' '\n' @@ -1687,7 +1672,7 @@ topics = {'assert': '\n' 'they\n' ' have equal *(key, value)* pairs. Equality comparison of the ' 'keys and\n' - ' elements enforces reflexivity.\n' + ' values enforces reflexivity.\n' '\n' ' Order comparisons ("<", ">", "<=", and ">=") raise ' '"TypeError".\n' @@ -1762,6 +1747,12 @@ topics = {'assert': '\n' ' to sequences, but not to sets or mappings). See also the\n' ' "total_ordering()" decorator.\n' '\n' + '* The "hash()" result should be consistent with equality. ' + 'Objects\n' + ' that are equal should either have the same hash value, or ' + 'be marked\n' + ' as unhashable.\n' + '\n' 'Python does not enforce these consistency rules. In fact, ' 'the\n' 'not-a-number values are an example for not following these ' @@ -1773,9 +1764,9 @@ topics = {'assert': '\n' '\n' 'The operators "in" and "not in" test for membership. "x in ' 's"\n' - 'evaluates to true if *x* is a member of *s*, and false ' - 'otherwise. "x\n' - 'not in s" returns the negation of "x in s". All built-in ' + 'evaluates to "True" if *x* is a member of *s*, and "False" ' + 'otherwise.\n' + '"x not in s" returns the negation of "x in s". All built-in ' 'sequences\n' 'and set types support this as well as dictionary, for which ' '"in" tests\n' @@ -1786,30 +1777,32 @@ topics = {'assert': '\n' 'for e in\n' 'y)".\n' '\n' - 'For the string and bytes types, "x in y" is true if and only ' - 'if *x* is\n' - 'a substring of *y*. An equivalent test is "y.find(x) != ' - '-1". Empty\n' - 'strings are always considered to be a substring of any other ' - 'string,\n' - 'so """ in "abc"" will return "True".\n' + 'For the string and bytes types, "x in y" is "True" if and ' + 'only if *x*\n' + 'is a substring of *y*. An equivalent test is "y.find(x) != ' + '-1".\n' + 'Empty strings are always considered to be a substring of any ' + 'other\n' + 'string, so """ in "abc"" will return "True".\n' '\n' 'For user-defined classes which define the "__contains__()" ' 'method, "x\n' - 'in y" is true if and only if "y.__contains__(x)" is true.\n' + 'in y" returns "True" if "y.__contains__(x)" returns a true ' + 'value, and\n' + '"False" otherwise.\n' '\n' 'For user-defined classes which do not define "__contains__()" ' 'but do\n' - 'define "__iter__()", "x in y" is true if some value "z" with ' - '"x == z"\n' - 'is produced while iterating over "y". If an exception is ' + 'define "__iter__()", "x in y" is "True" if some value "z" ' + 'with "x ==\n' + 'z" is produced while iterating over "y". If an exception is ' 'raised\n' 'during the iteration, it is as if "in" raised that ' 'exception.\n' '\n' 'Lastly, the old-style iteration protocol is tried: if a class ' 'defines\n' - '"__getitem__()", "x in y" is true if and only if there is a ' + '"__getitem__()", "x in y" is "True" if and only if there is a ' 'non-\n' 'negative integer index *i* such that "x == y[i]", and all ' 'lower\n' @@ -1833,8 +1826,7 @@ topics = {'assert': '\n' 'is determined using the "id()" function. "x is not y" yields ' 'the\n' 'inverse truth value. [4]\n', - 'compound': '\n' - 'Compound statements\n' + 'compound': 'Compound statements\n' '*******************\n' '\n' 'Compound statements contain (groups of) other statements; they ' @@ -2613,7 +2605,8 @@ topics = {'assert': '\n' 'functions, even if they do not contain "await" or "async" ' 'keywords.\n' '\n' - 'It is a "SyntaxError" to use "yield" expressions in "async def"\n' + 'It is a "SyntaxError" to use "yield from" expressions in "async ' + 'def"\n' 'coroutines.\n' '\n' 'An example of a coroutine function:\n' @@ -2724,8 +2717,7 @@ topics = {'assert': '\n' ' body is transformed into the namespace\'s "__doc__" item ' 'and\n' " therefore the class's *docstring*.\n", - 'context-managers': '\n' - 'With Statement Context Managers\n' + 'context-managers': 'With Statement Context Managers\n' '*******************************\n' '\n' 'A *context manager* is an object that defines the ' @@ -2787,8 +2779,7 @@ topics = {'assert': '\n' ' The specification, background, and examples for the ' 'Python "with"\n' ' statement.\n', - 'continue': '\n' - 'The "continue" statement\n' + 'continue': 'The "continue" statement\n' '************************\n' '\n' ' continue_stmt ::= "continue"\n' @@ -2805,8 +2796,7 @@ topics = {'assert': '\n' '"finally" clause, that "finally" clause is executed before ' 'really\n' 'starting the next loop cycle.\n', - 'conversions': '\n' - 'Arithmetic conversions\n' + 'conversions': 'Arithmetic conversions\n' '**********************\n' '\n' 'When a description of an arithmetic operator below uses the ' @@ -2832,8 +2822,7 @@ topics = {'assert': '\n' "left argument to the '%' operator). Extensions must define " 'their own\n' 'conversion behavior.\n', - 'customization': '\n' - 'Basic customization\n' + 'customization': 'Basic customization\n' '*******************\n' '\n' 'object.__new__(cls[, ...])\n' @@ -2855,11 +2844,11 @@ topics = {'assert': '\n' ' Typical implementations create a new instance of the ' 'class by\n' ' invoking the superclass\'s "__new__()" method using\n' - ' "super(currentclass, cls).__new__(cls[, ...])" with ' - 'appropriate\n' - ' arguments and then modifying the newly-created instance ' - 'as\n' - ' necessary before returning it.\n' + ' "super().__new__(cls[, ...])" with appropriate arguments ' + 'and then\n' + ' modifying the newly-created instance as necessary before ' + 'returning\n' + ' it.\n' '\n' ' If "__new__()" returns an instance of *cls*, then the ' 'new\n' @@ -2894,7 +2883,7 @@ topics = {'assert': '\n' ' any, must explicitly call it to ensure proper ' 'initialization of the\n' ' base class part of the instance; for example:\n' - ' "BaseClass.__init__(self, [args...])".\n' + ' "super().__init__([args...])".\n' '\n' ' Because "__new__()" and "__init__()" work together in ' 'constructing\n' @@ -3043,8 +3032,8 @@ topics = {'assert': '\n' '\n' 'object.__bytes__(self)\n' '\n' - ' Called by "bytes()" to compute a byte-string ' - 'representation of an\n' + ' Called by bytes to compute a byte-string representation ' + 'of an\n' ' object. This should return a "bytes" object.\n' '\n' 'object.__format__(self, format_spec)\n' @@ -3077,6 +3066,11 @@ topics = {'assert': '\n' '"object" itself\n' ' raises a "TypeError" if passed any non-empty string.\n' '\n' + ' Changed in version 3.7: "object.__format__(x, \'\')" is ' + 'now\n' + ' equivalent to "str(x)" rather than "format(str(self), ' + '\'\')".\n' + '\n' 'object.__lt__(self, other)\n' 'object.__le__(self, other)\n' 'object.__eq__(self, other)\n' @@ -3152,15 +3146,18 @@ topics = {'assert': '\n' 'on members\n' ' of hashed collections including "set", "frozenset", and ' '"dict".\n' - ' "__hash__()" should return an integer. The only ' - 'required property\n' + ' "__hash__()" should return an integer. The only required ' + 'property\n' ' is that objects which compare equal have the same hash ' 'value; it is\n' - ' advised to somehow mix together (e.g. using exclusive ' - 'or) the hash\n' - ' values for the components of the object that also play a ' - 'part in\n' - ' comparison of objects.\n' + ' advised to mix together the hash values of the ' + 'components of the\n' + ' object that also play a part in comparison of objects by ' + 'packing\n' + ' them into a tuple and hashing the tuple. Example:\n' + '\n' + ' def __hash__(self):\n' + ' return hash((self.name, self.nick, self.color))\n' '\n' ' Note: "hash()" truncates the value returned from an ' "object's\n" @@ -3211,8 +3208,8 @@ topics = {'assert': '\n' 'attempts to\n' ' retrieve their hash value, and will also be correctly ' 'identified as\n' - ' unhashable when checking "isinstance(obj, ' - 'collections.Hashable)".\n' + ' unhashable when checking "isinstance(obj,\n' + ' collections.abc.Hashable)".\n' '\n' ' If a class that overrides "__eq__()" needs to retain ' 'the\n' @@ -3229,8 +3226,8 @@ topics = {'assert': '\n' 'that\n' ' explicitly raises a "TypeError" would be incorrectly ' 'identified as\n' - ' hashable by an "isinstance(obj, collections.Hashable)" ' - 'call.\n' + ' hashable by an "isinstance(obj, ' + 'collections.abc.Hashable)" call.\n' '\n' ' Note: By default, the "__hash__()" values of str, bytes ' 'and\n' @@ -3272,8 +3269,7 @@ topics = {'assert': '\n' ' neither "__len__()" nor "__bool__()", all its instances ' 'are\n' ' considered true.\n', - 'debugger': '\n' - '"pdb" --- The Python Debugger\n' + 'debugger': '"pdb" --- The Python Debugger\n' '*****************************\n' '\n' '**Source code:** Lib/pdb.py\n' @@ -3360,7 +3356,7 @@ topics = {'assert': '\n' ' >>> import mymodule\n' ' >>> mymodule.test()\n' ' Traceback (most recent call last):\n' - ' File "<stdin>", line 1, in ?\n' + ' File "<stdin>", line 1, in <module>\n' ' File "./mymodule.py", line 4, in test\n' ' test2()\n' ' File "./mymodule.py", line 3, in test2\n' @@ -3702,7 +3698,7 @@ topics = {'assert': '\n' ' end). This is because any time you resume execution (even ' 'with a\n' ' simple next or step), you may encounter another ' - 'breakpoint--which\n' + 'breakpoint—which\n' ' could have its own command list, leading to ambiguities about ' 'which\n' ' list to execute.\n' @@ -3938,8 +3934,7 @@ topics = {'assert': '\n' '[1] Whether a frame is considered to originate in a certain ' 'module\n' ' is determined by the "__name__" in the frame globals.\n', - 'del': '\n' - 'The "del" statement\n' + 'del': 'The "del" statement\n' '*******************\n' '\n' ' del_stmt ::= "del" target_list\n' @@ -3968,8 +3963,7 @@ topics = {'assert': '\n' 'Changed in version 3.2: Previously it was illegal to delete a name\n' 'from the local namespace if it occurs as a free variable in a nested\n' 'block.\n', - 'dict': '\n' - 'Dictionary displays\n' + 'dict': 'Dictionary displays\n' '*******************\n' '\n' 'A dictionary display is a possibly empty series of key/datum pairs\n' @@ -4013,8 +4007,7 @@ topics = {'assert': '\n' 'should be *hashable*, which excludes all mutable objects.) Clashes\n' 'between duplicate keys are not detected; the last datum (textually\n' 'rightmost in the display) stored for a given key value prevails.\n', - 'dynamic-features': '\n' - 'Interaction with dynamic features\n' + 'dynamic-features': 'Interaction with dynamic features\n' '*********************************\n' '\n' 'Name resolution of free variables occurs at runtime, not ' @@ -4027,16 +4020,6 @@ topics = {'assert': '\n' ' i = 42\n' ' f()\n' '\n' - 'There are several cases where Python statements are ' - 'illegal when used\n' - 'in conjunction with nested scopes that contain free ' - 'variables.\n' - '\n' - 'If a variable is referenced in an enclosing scope, it is ' - 'illegal to\n' - 'delete the name. An error will be reported at compile ' - 'time.\n' - '\n' 'The "eval()" and "exec()" functions do not have access ' 'to the full\n' 'environment for resolving names. Names may be resolved ' @@ -4050,8 +4033,7 @@ topics = {'assert': '\n' 'override the global and local namespace. If only one ' 'namespace is\n' 'specified, it is used for both.\n', - 'else': '\n' - 'The "if" statement\n' + 'else': 'The "if" statement\n' '******************\n' '\n' 'The "if" statement is used for conditional execution:\n' @@ -4068,8 +4050,7 @@ topics = {'assert': '\n' '(and no other part of the "if" statement is executed or evaluated).\n' 'If all expressions are false, the suite of the "else" clause, if\n' 'present, is executed.\n', - 'exceptions': '\n' - 'Exceptions\n' + 'exceptions': 'Exceptions\n' '**********\n' '\n' 'Exceptions are a means of breaking out of the normal flow of ' @@ -4145,8 +4126,7 @@ topics = {'assert': '\n' ' these operations is not available at the time the module ' 'is\n' ' compiled.\n', - 'execmodel': '\n' - 'Execution model\n' + 'execmodel': 'Execution model\n' '***************\n' '\n' '\n' @@ -4343,6 +4323,13 @@ topics = {'assert': '\n' 'Builtins and restricted execution\n' '---------------------------------\n' '\n' + '**CPython implementation detail:** Users should not touch\n' + '"__builtins__"; it is strictly an implementation detail. ' + 'Users\n' + 'wanting to override values in the builtins namespace should ' + '"import"\n' + 'the "builtins" module and modify its attributes appropriately.\n' + '\n' 'The builtins namespace associated with the execution of a code ' 'block\n' 'is actually found by looking up the name "__builtins__" in its ' @@ -4355,16 +4342,7 @@ topics = {'assert': '\n' 'in any\n' 'other module, "__builtins__" is an alias for the dictionary of ' 'the\n' - '"builtins" module itself. "__builtins__" can be set to a ' - 'user-created\n' - 'dictionary to create a weak form of restricted execution.\n' - '\n' - '**CPython implementation detail:** Users should not touch\n' - '"__builtins__"; it is strictly an implementation detail. ' - 'Users\n' - 'wanting to override values in the builtins namespace should ' - '"import"\n' - 'the "builtins" module and modify its attributes appropriately.\n' + '"builtins" module itself.\n' '\n' '\n' 'Interaction with dynamic features\n' @@ -4380,14 +4358,6 @@ topics = {'assert': '\n' ' i = 42\n' ' f()\n' '\n' - 'There are several cases where Python statements are illegal ' - 'when used\n' - 'in conjunction with nested scopes that contain free variables.\n' - '\n' - 'If a variable is referenced in an enclosing scope, it is ' - 'illegal to\n' - 'delete the name. An error will be reported at compile time.\n' - '\n' 'The "eval()" and "exec()" functions do not have access to the ' 'full\n' 'environment for resolving names. Names may be resolved in the ' @@ -4477,8 +4447,7 @@ topics = {'assert': '\n' ' these operations is not available at the time the module ' 'is\n' ' compiled.\n', - 'exprlists': '\n' - 'Expression lists\n' + 'exprlists': 'Expression lists\n' '****************\n' '\n' ' expression_list ::= expression ( "," expression )* [","]\n' @@ -4515,8 +4484,7 @@ topics = {'assert': '\n' 'value of that expression. (To create an empty tuple, use an ' 'empty pair\n' 'of parentheses: "()".)\n', - 'floating': '\n' - 'Floating point literals\n' + 'floating': 'Floating point literals\n' '***********************\n' '\n' 'Floating point literals are described by the following lexical\n' @@ -4552,8 +4520,7 @@ topics = {'assert': '\n' 'Changed in version 3.6: Underscores are now allowed for ' 'grouping\n' 'purposes in literals.\n', - 'for': '\n' - 'The "for" statement\n' + 'for': 'The "for" statement\n' '*******************\n' '\n' 'The "for" statement is used to iterate over the elements of a ' @@ -4625,8 +4592,7 @@ topics = {'assert': '\n' '\n' ' for x in a[:]:\n' ' if x < 0: a.remove(x)\n', - 'formatstrings': '\n' - 'Format String Syntax\n' + 'formatstrings': 'Format String Syntax\n' '********************\n' '\n' 'The "str.format()" method and the "Formatter" class share ' @@ -5066,9 +5032,9 @@ topics = {'assert': '\n' 'be formatted\n' 'with the floating point presentation types listed below ' '(except "\'n\'"\n' - 'and None). When doing so, "float()" is used to convert the ' - 'integer to\n' - 'a floating point number before formatting.\n' + 'and "None"). When doing so, "float()" is used to convert ' + 'the integer\n' + 'to a floating point number before formatting.\n' '\n' 'The available presentation types for floating point and ' 'decimal values\n' @@ -5345,8 +5311,7 @@ topics = {'assert': '\n' ' 9 9 11 1001\n' ' 10 A 12 1010\n' ' 11 B 13 1011\n', - 'function': '\n' - 'Function definitions\n' + 'function': 'Function definitions\n' '********************\n' '\n' 'A function definition defines a user-defined function object ' @@ -5515,8 +5480,7 @@ topics = {'assert': '\n' '\n' ' **PEP 3107** - Function Annotations\n' ' The original specification for function annotations.\n', - 'global': '\n' - 'The "global" statement\n' + 'global': 'The "global" statement\n' '**********************\n' '\n' ' global_stmt ::= "global" identifier ("," identifier)*\n' @@ -5547,8 +5511,8 @@ topics = {'assert': '\n' 'change\n' 'the meaning of the program.\n' '\n' - '**Programmer\'s note:** the "global" is a directive to the ' - 'parser. It\n' + '**Programmer\'s note:** "global" is a directive to the parser. ' + 'It\n' 'applies only to code parsed at the same time as the "global"\n' 'statement. In particular, a "global" statement contained in a ' 'string\n' @@ -5560,8 +5524,7 @@ topics = {'assert': '\n' 'code containing the function call. The same applies to the ' '"eval()"\n' 'and "compile()" functions.\n', - 'id-classes': '\n' - 'Reserved classes of identifiers\n' + 'id-classes': 'Reserved classes of identifiers\n' '*******************************\n' '\n' 'Certain classes of identifiers (besides keywords) have ' @@ -5609,8 +5572,7 @@ topics = {'assert': '\n' ' to help avoid name clashes between "private" attributes of ' 'base and\n' ' derived classes. See section Identifiers (Names).\n', - 'identifiers': '\n' - 'Identifiers and keywords\n' + 'identifiers': 'Identifiers and keywords\n' '************************\n' '\n' 'Identifiers (also referred to as *names*) are described by ' @@ -5758,8 +5720,7 @@ topics = {'assert': '\n' ' to help avoid name clashes between "private" attributes of ' 'base and\n' ' derived classes. See section Identifiers (Names).\n', - 'if': '\n' - 'The "if" statement\n' + 'if': 'The "if" statement\n' '******************\n' '\n' 'The "if" statement is used for conditional execution:\n' @@ -5775,8 +5736,7 @@ topics = {'assert': '\n' '(and no other part of the "if" statement is executed or evaluated).\n' 'If all expressions are false, the suite of the "else" clause, if\n' 'present, is executed.\n', - 'imaginary': '\n' - 'Imaginary literals\n' + 'imaginary': 'Imaginary literals\n' '******************\n' '\n' 'Imaginary literals are described by the following lexical ' @@ -5796,8 +5756,7 @@ topics = {'assert': '\n' '\n' ' 3.14j 10.j 10j .001j 1e100j 3.14e-10j ' '3.14_15_93j\n', - 'import': '\n' - 'The "import" statement\n' + 'import': 'The "import" statement\n' '**********************\n' '\n' ' import_stmt ::= "import" module ["as" name] ( "," module ' @@ -6058,13 +6017,13 @@ topics = {'assert': '\n' '\n' ' **PEP 236** - Back to the __future__\n' ' The original proposal for the __future__ mechanism.\n', - 'in': '\n' - 'Membership test operations\n' + 'in': 'Membership test operations\n' '**************************\n' '\n' 'The operators "in" and "not in" test for membership. "x in s"\n' - 'evaluates to true if *x* is a member of *s*, and false otherwise. "x\n' - 'not in s" returns the negation of "x in s". All built-in sequences\n' + 'evaluates to "True" if *x* is a member of *s*, and "False" otherwise.\n' + '"x not in s" returns the negation of "x in s". All built-in ' + 'sequences\n' 'and set types support this as well as dictionary, for which "in" ' 'tests\n' 'whether the dictionary has a given key. For container types such as\n' @@ -6072,30 +6031,29 @@ topics = {'assert': '\n' 'expression "x in y" is equivalent to "any(x is e or x == e for e in\n' 'y)".\n' '\n' - 'For the string and bytes types, "x in y" is true if and only if *x* ' - 'is\n' - 'a substring of *y*. An equivalent test is "y.find(x) != -1". Empty\n' - 'strings are always considered to be a substring of any other string,\n' - 'so """ in "abc"" will return "True".\n' + 'For the string and bytes types, "x in y" is "True" if and only if *x*\n' + 'is a substring of *y*. An equivalent test is "y.find(x) != -1".\n' + 'Empty strings are always considered to be a substring of any other\n' + 'string, so """ in "abc"" will return "True".\n' '\n' 'For user-defined classes which define the "__contains__()" method, "x\n' - 'in y" is true if and only if "y.__contains__(x)" is true.\n' + 'in y" returns "True" if "y.__contains__(x)" returns a true value, and\n' + '"False" otherwise.\n' '\n' 'For user-defined classes which do not define "__contains__()" but do\n' - 'define "__iter__()", "x in y" is true if some value "z" with "x == z"\n' - 'is produced while iterating over "y". If an exception is raised\n' + 'define "__iter__()", "x in y" is "True" if some value "z" with "x ==\n' + 'z" is produced while iterating over "y". If an exception is raised\n' 'during the iteration, it is as if "in" raised that exception.\n' '\n' 'Lastly, the old-style iteration protocol is tried: if a class defines\n' - '"__getitem__()", "x in y" is true if and only if there is a non-\n' + '"__getitem__()", "x in y" is "True" if and only if there is a non-\n' 'negative integer index *i* such that "x == y[i]", and all lower\n' 'integer indices do not raise "IndexError" exception. (If any other\n' 'exception is raised, it is as if "in" raised that exception).\n' '\n' 'The operator "not in" is defined to have the inverse true value of\n' '"in".\n', - 'integers': '\n' - 'Integer literals\n' + 'integers': 'Integer literals\n' '****************\n' '\n' 'Integer literals are described by the following lexical ' @@ -6141,8 +6099,7 @@ topics = {'assert': '\n' 'Changed in version 3.6: Underscores are now allowed for ' 'grouping\n' 'purposes in literals.\n', - 'lambda': '\n' - 'Lambdas\n' + 'lambda': 'Lambdas\n' '*******\n' '\n' ' lambda_expr ::= "lambda" [parameter_list]: expression\n' @@ -6165,8 +6122,7 @@ topics = {'assert': '\n' 'Note that functions created with lambda expressions cannot ' 'contain\n' 'statements or annotations.\n', - 'lists': '\n' - 'List displays\n' + 'lists': 'List displays\n' '*************\n' '\n' 'A list display is a possibly empty series of expressions enclosed ' @@ -6183,8 +6139,7 @@ topics = {'assert': '\n' 'from left to right and placed into the list object in that order.\n' 'When a comprehension is supplied, the list is constructed from the\n' 'elements resulting from the comprehension.\n', - 'naming': '\n' - 'Naming and binding\n' + 'naming': 'Naming and binding\n' '******************\n' '\n' '\n' @@ -6341,6 +6296,12 @@ topics = {'assert': '\n' 'Builtins and restricted execution\n' '=================================\n' '\n' + '**CPython implementation detail:** Users should not touch\n' + '"__builtins__"; it is strictly an implementation detail. Users\n' + 'wanting to override values in the builtins namespace should ' + '"import"\n' + 'the "builtins" module and modify its attributes appropriately.\n' + '\n' 'The builtins namespace associated with the execution of a code ' 'block\n' 'is actually found by looking up the name "__builtins__" in its ' @@ -6353,15 +6314,7 @@ topics = {'assert': '\n' 'any\n' 'other module, "__builtins__" is an alias for the dictionary of ' 'the\n' - '"builtins" module itself. "__builtins__" can be set to a ' - 'user-created\n' - 'dictionary to create a weak form of restricted execution.\n' - '\n' - '**CPython implementation detail:** Users should not touch\n' - '"__builtins__"; it is strictly an implementation detail. Users\n' - 'wanting to override values in the builtins namespace should ' - '"import"\n' - 'the "builtins" module and modify its attributes appropriately.\n' + '"builtins" module itself.\n' '\n' '\n' 'Interaction with dynamic features\n' @@ -6377,14 +6330,6 @@ topics = {'assert': '\n' ' i = 42\n' ' f()\n' '\n' - 'There are several cases where Python statements are illegal when ' - 'used\n' - 'in conjunction with nested scopes that contain free variables.\n' - '\n' - 'If a variable is referenced in an enclosing scope, it is illegal ' - 'to\n' - 'delete the name. An error will be reported at compile time.\n' - '\n' 'The "eval()" and "exec()" functions do not have access to the ' 'full\n' 'environment for resolving names. Names may be resolved in the ' @@ -6397,8 +6342,7 @@ topics = {'assert': '\n' 'override the global and local namespace. If only one namespace ' 'is\n' 'specified, it is used for both.\n', - 'nonlocal': '\n' - 'The "nonlocal" statement\n' + 'nonlocal': 'The "nonlocal" statement\n' '************************\n' '\n' ' nonlocal_stmt ::= "nonlocal" identifier ("," identifier)*\n' @@ -6429,8 +6373,7 @@ topics = {'assert': '\n' '\n' ' **PEP 3104** - Access to Names in Outer Scopes\n' ' The specification for the "nonlocal" statement.\n', - 'numbers': '\n' - 'Numeric literals\n' + 'numbers': 'Numeric literals\n' '****************\n' '\n' 'There are three types of numeric literals: integers, floating ' @@ -6444,8 +6387,7 @@ topics = {'assert': '\n' 'is actually an expression composed of the unary operator \'"-"\' ' 'and the\n' 'literal "1".\n', - 'numeric-types': '\n' - 'Emulating numeric types\n' + 'numeric-types': 'Emulating numeric types\n' '***********************\n' '\n' 'The following methods can be defined to emulate numeric ' @@ -6621,8 +6563,7 @@ topics = {'assert': '\n' ' "__index__()" is defined "__int__()" should also be ' 'defined, and\n' ' both should return the same value.\n', - 'objects': '\n' - 'Objects, values and types\n' + 'objects': 'Objects, values and types\n' '*************************\n' '\n' "*Objects* are Python's abstraction for data. All data in a " @@ -6750,8 +6691,7 @@ topics = {'assert': '\n' 'created empty lists. (Note that "c = d = []" assigns the same ' 'object\n' 'to both "c" and "d".)\n', - 'operator-summary': '\n' - 'Operator precedence\n' + 'operator-summary': 'Operator precedence\n' '*******************\n' '\n' 'The following table summarizes the operator precedence ' @@ -6812,7 +6752,9 @@ topics = {'assert': '\n' 'Addition and subtraction |\n' '+-------------------------------------------------+---------------------------------------+\n' '| "*", "@", "/", "//", "%" | ' - 'Multiplication, matrix multiplication |\n' + 'Multiplication, matrix |\n' + '| | ' + 'multiplication, division, floor |\n' '| | ' 'division, remainder [5] |\n' '+-------------------------------------------------+---------------------------------------+\n' @@ -6924,8 +6866,7 @@ topics = {'assert': '\n' 'arithmetic\n' ' or bitwise unary operator on its right, that is, ' '"2**-1" is "0.5".\n', - 'pass': '\n' - 'The "pass" statement\n' + 'pass': 'The "pass" statement\n' '********************\n' '\n' ' pass_stmt ::= "pass"\n' @@ -6938,8 +6879,7 @@ topics = {'assert': '\n' ' def f(arg): pass # a function that does nothing (yet)\n' '\n' ' class C: pass # a class with no methods (yet)\n', - 'power': '\n' - 'The power operator\n' + 'power': 'The power operator\n' '******************\n' '\n' 'The power operator binds more tightly than unary operators on its\n' @@ -6973,8 +6913,7 @@ topics = {'assert': '\n' 'Raising a negative number to a fractional power results in a ' '"complex"\n' 'number. (In earlier versions it raised a "ValueError".)\n', - 'raise': '\n' - 'The "raise" statement\n' + 'raise': 'The "raise" statement\n' '*********************\n' '\n' ' raise_stmt ::= "raise" [expression ["from" expression]]\n' @@ -7024,7 +6963,7 @@ topics = {'assert': '\n' ' ...\n' ' Traceback (most recent call last):\n' ' File "<stdin>", line 2, in <module>\n' - ' ZeroDivisionError: int division or modulo by zero\n' + ' ZeroDivisionError: division by zero\n' '\n' ' The above exception was the direct cause of the following ' 'exception:\n' @@ -7046,7 +6985,7 @@ topics = {'assert': '\n' ' ...\n' ' Traceback (most recent call last):\n' ' File "<stdin>", line 2, in <module>\n' - ' ZeroDivisionError: int division or modulo by zero\n' + ' ZeroDivisionError: division by zero\n' '\n' ' During handling of the above exception, another exception ' 'occurred:\n' @@ -7055,12 +6994,31 @@ topics = {'assert': '\n' ' File "<stdin>", line 4, in <module>\n' ' RuntimeError: Something bad happened\n' '\n' + 'Exception chaining can be explicitly suppressed by specifying ' + '"None"\n' + 'in the "from" clause:\n' + '\n' + ' >>> try:\n' + ' ... print(1 / 0)\n' + ' ... except:\n' + ' ... raise RuntimeError("Something bad happened") from None\n' + ' ...\n' + ' Traceback (most recent call last):\n' + ' File "<stdin>", line 4, in <module>\n' + ' RuntimeError: Something bad happened\n' + '\n' 'Additional information on exceptions can be found in section\n' 'Exceptions, and information about handling exceptions is in ' 'section\n' - 'The try statement.\n', - 'return': '\n' - 'The "return" statement\n' + 'The try statement.\n' + '\n' + 'Changed in version 3.3: "None" is now permitted as "Y" in "raise X\n' + 'from Y".\n' + '\n' + 'New in version 3.3: The "__suppress_context__" attribute to ' + 'suppress\n' + 'automatic display of the exception context.\n', + 'return': 'The "return" statement\n' '**********************\n' '\n' ' return_stmt ::= "return" [expression_list]\n' @@ -7087,9 +7045,15 @@ topics = {'assert': '\n' 'generator is done and will cause "StopIteration" to be raised. ' 'The\n' 'returned value (if any) is used as an argument to construct\n' - '"StopIteration" and becomes the "StopIteration.value" attribute.\n', - 'sequence-types': '\n' - 'Emulating container types\n' + '"StopIteration" and becomes the "StopIteration.value" attribute.\n' + '\n' + 'In an asynchronous generator function, an empty "return" ' + 'statement\n' + 'indicates that the asynchronous generator is done and will cause\n' + '"StopAsyncIteration" to be raised. A non-empty "return" statement ' + 'is\n' + 'a syntax error in an asynchronous generator function.\n', + 'sequence-types': 'Emulating container types\n' '*************************\n' '\n' 'The following methods can be defined to implement ' @@ -7114,7 +7078,7 @@ topics = {'assert': '\n' '"update()"\n' "behaving similar to those for Python's standard dictionary " 'objects.\n' - 'The "collections" module provides a "MutableMapping" ' + 'The "collections.abc" module provides a "MutableMapping" ' 'abstract base\n' 'class to help create those methods from a base set of ' '"__getitem__()",\n' @@ -7161,6 +7125,16 @@ topics = {'assert': '\n' ' returns zero is considered to be false in a Boolean ' 'context.\n' '\n' + ' **CPython implementation detail:** In CPython, the ' + 'length is\n' + ' required to be at most "sys.maxsize". If the length is ' + 'larger than\n' + ' "sys.maxsize" some features (such as "len()") may ' + 'raise\n' + ' "OverflowError". To prevent raising "OverflowError" by ' + 'truth value\n' + ' testing, an object must define a "__bool__()" method.\n' + '\n' 'object.__length_hint__(self)\n' '\n' ' Called to implement "operator.length_hint()". Should ' @@ -7310,8 +7284,7 @@ topics = {'assert': '\n' ' iteration protocol via "__getitem__()", see this ' 'section in the\n' ' language reference.\n', - 'shifting': '\n' - 'Shifting operations\n' + 'shifting': 'Shifting operations\n' '*******************\n' '\n' 'The shifting operations have lower priority than the arithmetic\n' @@ -7328,15 +7301,8 @@ topics = {'assert': '\n' 'A right shift by *n* bits is defined as floor division by ' '"pow(2,n)".\n' 'A left shift by *n* bits is defined as multiplication with ' - '"pow(2,n)".\n' - '\n' - 'Note: In the current implementation, the right-hand operand is\n' - ' required to be at most "sys.maxsize". If the right-hand ' - 'operand is\n' - ' larger than "sys.maxsize" an "OverflowError" exception is ' - 'raised.\n', - 'slicings': '\n' - 'Slicings\n' + '"pow(2,n)".\n', + 'slicings': 'Slicings\n' '********\n' '\n' 'A slicing selects a range of items in a sequence object (e.g., ' @@ -7387,8 +7353,7 @@ topics = {'assert': '\n' 'as lower bound, upper bound and stride, respectively, ' 'substituting\n' '"None" for missing expressions.\n', - 'specialattrs': '\n' - 'Special Attributes\n' + 'specialattrs': 'Special Attributes\n' '******************\n' '\n' 'The implementation adds a few special read-only attributes ' @@ -7473,8 +7438,7 @@ topics = {'assert': '\n' '[5] To format only a tuple you should therefore provide a\n' ' singleton tuple whose only element is the tuple to be ' 'formatted.\n', - 'specialnames': '\n' - 'Special method names\n' + 'specialnames': 'Special method names\n' '********************\n' '\n' 'A class can implement certain operations that are invoked by ' @@ -7540,11 +7504,11 @@ topics = {'assert': '\n' ' Typical implementations create a new instance of the ' 'class by\n' ' invoking the superclass\'s "__new__()" method using\n' - ' "super(currentclass, cls).__new__(cls[, ...])" with ' - 'appropriate\n' - ' arguments and then modifying the newly-created instance ' - 'as\n' - ' necessary before returning it.\n' + ' "super().__new__(cls[, ...])" with appropriate arguments ' + 'and then\n' + ' modifying the newly-created instance as necessary before ' + 'returning\n' + ' it.\n' '\n' ' If "__new__()" returns an instance of *cls*, then the ' 'new\n' @@ -7579,7 +7543,7 @@ topics = {'assert': '\n' ' any, must explicitly call it to ensure proper ' 'initialization of the\n' ' base class part of the instance; for example:\n' - ' "BaseClass.__init__(self, [args...])".\n' + ' "super().__init__([args...])".\n' '\n' ' Because "__new__()" and "__init__()" work together in ' 'constructing\n' @@ -7726,8 +7690,8 @@ topics = {'assert': '\n' '\n' 'object.__bytes__(self)\n' '\n' - ' Called by "bytes()" to compute a byte-string ' - 'representation of an\n' + ' Called by bytes to compute a byte-string representation ' + 'of an\n' ' object. This should return a "bytes" object.\n' '\n' 'object.__format__(self, format_spec)\n' @@ -7760,6 +7724,11 @@ topics = {'assert': '\n' 'itself\n' ' raises a "TypeError" if passed any non-empty string.\n' '\n' + ' Changed in version 3.7: "object.__format__(x, \'\')" is ' + 'now\n' + ' equivalent to "str(x)" rather than "format(str(self), ' + '\'\')".\n' + '\n' 'object.__lt__(self, other)\n' 'object.__le__(self, other)\n' 'object.__eq__(self, other)\n' @@ -7835,15 +7804,18 @@ topics = {'assert': '\n' 'on members\n' ' of hashed collections including "set", "frozenset", and ' '"dict".\n' - ' "__hash__()" should return an integer. The only required ' + ' "__hash__()" should return an integer. The only required ' 'property\n' ' is that objects which compare equal have the same hash ' 'value; it is\n' - ' advised to somehow mix together (e.g. using exclusive or) ' - 'the hash\n' - ' values for the components of the object that also play a ' - 'part in\n' - ' comparison of objects.\n' + ' advised to mix together the hash values of the components ' + 'of the\n' + ' object that also play a part in comparison of objects by ' + 'packing\n' + ' them into a tuple and hashing the tuple. Example:\n' + '\n' + ' def __hash__(self):\n' + ' return hash((self.name, self.nick, self.color))\n' '\n' ' Note: "hash()" truncates the value returned from an ' "object's\n" @@ -7893,8 +7865,8 @@ topics = {'assert': '\n' 'attempts to\n' ' retrieve their hash value, and will also be correctly ' 'identified as\n' - ' unhashable when checking "isinstance(obj, ' - 'collections.Hashable)".\n' + ' unhashable when checking "isinstance(obj,\n' + ' collections.abc.Hashable)".\n' '\n' ' If a class that overrides "__eq__()" needs to retain the\n' ' implementation of "__hash__()" from a parent class, the ' @@ -7910,8 +7882,8 @@ topics = {'assert': '\n' 'that\n' ' explicitly raises a "TypeError" would be incorrectly ' 'identified as\n' - ' hashable by an "isinstance(obj, collections.Hashable)" ' - 'call.\n' + ' hashable by an "isinstance(obj, ' + 'collections.abc.Hashable)" call.\n' '\n' ' Note: By default, the "__hash__()" values of str, bytes ' 'and\n' @@ -8221,23 +8193,14 @@ topics = {'assert': '\n' '__slots__\n' '---------\n' '\n' - 'By default, instances of classes have a dictionary for ' - 'attribute\n' - 'storage. This wastes space for objects having very few ' - 'instance\n' - 'variables. The space consumption can become acute when ' - 'creating large\n' - 'numbers of instances.\n' + '*__slots__* allow us to explicitly declare data members ' + '(like\n' + 'properties) and deny the creation of *__dict__* and ' + '*__weakref__*\n' + '(unless explicitly declared in *__slots__* or available in a ' + 'parent.)\n' '\n' - 'The default can be overridden by defining *__slots__* in a ' - 'class\n' - 'definition. The *__slots__* declaration takes a sequence of ' - 'instance\n' - 'variables and reserves just enough space in each instance to ' - 'hold a\n' - 'value for each variable. Space is saved because *__dict__* ' - 'is not\n' - 'created for each instance.\n' + 'The space saved over using *__dict__* can be significant.\n' '\n' 'object.__slots__\n' '\n' @@ -8257,9 +8220,9 @@ topics = {'assert': '\n' '\n' '* When inheriting from a class without *__slots__*, the ' '*__dict__*\n' - ' attribute of that class will always be accessible, so a ' - '*__slots__*\n' - ' definition in the subclass is meaningless.\n' + ' and *__weakref__* attribute of the instances will always ' + 'be\n' + ' accessible.\n' '\n' '* Without a *__dict__* variable, instances cannot be ' 'assigned new\n' @@ -8291,13 +8254,16 @@ topics = {'assert': '\n' 'class\n' ' attribute would overwrite the descriptor assignment.\n' '\n' - '* The action of a *__slots__* declaration is limited to the ' - 'class\n' - ' where it is defined. As a result, subclasses will have a ' - '*__dict__*\n' - ' unless they also define *__slots__* (which must only ' - 'contain names\n' - ' of any *additional* slots).\n' + '* The action of a *__slots__* declaration is not limited to ' + 'the\n' + ' class where it is defined. *__slots__* declared in ' + 'parents are\n' + ' available in child classes. However, child subclasses will ' + 'get a\n' + ' *__dict__* and *__weakref__* unless they also define ' + '*__slots__*\n' + ' (which should only contain names of any *additional* ' + 'slots).\n' '\n' '* If a class defines a slot also defined in a base class, ' 'the\n' @@ -8324,6 +8290,14 @@ topics = {'assert': '\n' 'same\n' ' *__slots__*.\n' '\n' + '* Multiple inheritance with multiple slotted parent classes ' + 'can be\n' + ' used, but only one parent is allowed to have attributes ' + 'created by\n' + ' slots (the other bases must have empty slot layouts) - ' + 'violations\n' + ' raise "TypeError".\n' + '\n' '\n' 'Customizing class creation\n' '==========================\n' @@ -8503,9 +8477,10 @@ topics = {'assert': '\n' 'defined at the\n' 'class scope. Class variables must be accessed through the ' 'first\n' - 'parameter of instance or class methods, and cannot be ' - 'accessed at all\n' - 'from static methods.\n' + 'parameter of instance or class methods, or through the ' + 'implicit\n' + 'lexically scoped "__class__" reference described in the next ' + 'section.\n' '\n' '\n' 'Creating the class object\n' @@ -8535,6 +8510,38 @@ topics = {'assert': '\n' 'passed to the\n' 'method.\n' '\n' + '**CPython implementation detail:** In CPython 3.6 and later, ' + 'the\n' + '"__class__" cell is passed to the metaclass as a ' + '"__classcell__" entry\n' + 'in the class namespace. If present, this must be propagated ' + 'up to the\n' + '"type.__new__" call in order for the class to be ' + 'initialised\n' + 'correctly. Failing to do so will result in a ' + '"DeprecationWarning" in\n' + 'Python 3.6, and a "RuntimeWarning" in the future.\n' + '\n' + 'When using the default metaclass "type", or any metaclass ' + 'that\n' + 'ultimately calls "type.__new__", the following additional\n' + 'customisation steps are invoked after creating the class ' + 'object:\n' + '\n' + '* first, "type.__new__" collects all of the descriptors in ' + 'the class\n' + ' namespace that define a "__set_name__()" method;\n' + '\n' + '* second, all of these "__set_name__" methods are called ' + 'with the\n' + ' class being defined and the assigned name of that ' + 'particular\n' + ' descriptor; and\n' + '\n' + '* finally, the "__init_subclass__()" hook is called on the ' + 'immediate\n' + ' parent of the new class in its method resolution order.\n' + '\n' 'After the class object is created, it is passed to the ' 'class\n' 'decorators included in the class definition (if any) and the ' @@ -8562,7 +8569,7 @@ topics = {'assert': '\n' '\n' 'The potential uses for metaclasses are boundless. Some ideas ' 'that have\n' - 'been explored include logging, interface checking, ' + 'been explored include enum, logging, interface checking, ' 'automatic\n' 'delegation, automatic property creation, proxies, ' 'frameworks, and\n' @@ -8701,7 +8708,7 @@ topics = {'assert': '\n' '"update()"\n' "behaving similar to those for Python's standard dictionary " 'objects.\n' - 'The "collections" module provides a "MutableMapping" ' + 'The "collections.abc" module provides a "MutableMapping" ' 'abstract base\n' 'class to help create those methods from a base set of ' '"__getitem__()",\n' @@ -8747,6 +8754,15 @@ topics = {'assert': '\n' ' returns zero is considered to be false in a Boolean ' 'context.\n' '\n' + ' **CPython implementation detail:** In CPython, the length ' + 'is\n' + ' required to be at most "sys.maxsize". If the length is ' + 'larger than\n' + ' "sys.maxsize" some features (such as "len()") may raise\n' + ' "OverflowError". To prevent raising "OverflowError" by ' + 'truth value\n' + ' testing, an object must define a "__bool__()" method.\n' + '\n' 'object.__length_hint__(self)\n' '\n' ' Called to implement "operator.length_hint()". Should ' @@ -9229,8 +9245,7 @@ topics = {'assert': '\n' 'special method *must* be set on the class object itself in ' 'order to be\n' 'consistently invoked by the interpreter).\n', - 'string-methods': '\n' - 'String Methods\n' + 'string-methods': 'String Methods\n' '**************\n' '\n' 'Strings implement all of the common sequence operations, ' @@ -9467,12 +9482,11 @@ topics = {'assert': '\n' 'characters\n' ' and there is at least one character, false otherwise. ' 'Decimal\n' - ' characters are those from general category "Nd". This ' - 'category\n' - ' includes digit characters, and all characters that can ' - 'be used to\n' - ' form decimal-radix numbers, e.g. U+0660, ARABIC-INDIC ' - 'DIGIT ZERO.\n' + ' characters are those that can be used to form numbers ' + 'in base 10,\n' + ' e.g. U+0660, ARABIC-INDIC DIGIT ZERO. Formally a ' + 'decimal character\n' + ' is a character in the Unicode General Category "Nd".\n' '\n' 'str.isdigit()\n' '\n' @@ -9482,10 +9496,13 @@ topics = {'assert': '\n' 'include decimal\n' ' characters and digits that need special handling, such ' 'as the\n' - ' compatibility superscript digits. Formally, a digit is ' - 'a character\n' - ' that has the property value Numeric_Type=Digit or\n' - ' Numeric_Type=Decimal.\n' + ' compatibility superscript digits. This covers digits ' + 'which cannot\n' + ' be used to form numbers in base 10, like the Kharosthi ' + 'numbers.\n' + ' Formally, a digit is a character that has the property ' + 'value\n' + ' Numeric_Type=Digit or Numeric_Type=Decimal.\n' '\n' 'str.isidentifier()\n' '\n' @@ -9570,13 +9587,13 @@ topics = {'assert': '\n' 'str.join(iterable)\n' '\n' ' Return a string which is the concatenation of the ' - 'strings in the\n' - ' *iterable* *iterable*. A "TypeError" will be raised if ' - 'there are\n' - ' any non-string values in *iterable*, including "bytes" ' - 'objects.\n' - ' The separator between elements is the string providing ' - 'this method.\n' + 'strings in\n' + ' *iterable*. A "TypeError" will be raised if there are ' + 'any non-\n' + ' string values in *iterable*, including "bytes" ' + 'objects. The\n' + ' separator between elements is the string providing this ' + 'method.\n' '\n' 'str.ljust(width[, fillchar])\n' '\n' @@ -9626,7 +9643,7 @@ topics = {'assert': '\n' ' Unicode ordinals (integers) or characters (strings of ' 'length 1) to\n' ' Unicode ordinals, strings (of arbitrary lengths) or ' - 'None.\n' + '"None".\n' ' Character keys will then be converted to ordinals.\n' '\n' ' If there are two arguments, they must be strings of ' @@ -9637,7 +9654,7 @@ topics = {'assert': '\n' 'is a third\n' ' argument, it must be a string, whose characters will be ' 'mapped to\n' - ' None in the result.\n' + ' "None" in the result.\n' '\n' 'str.partition(sep)\n' '\n' @@ -10031,8 +10048,7 @@ topics = {'assert': '\n' " '00042'\n" ' >>> "-42".zfill(5)\n' " '-0042'\n", - 'strings': '\n' - 'String and Bytes literals\n' + 'strings': 'String and Bytes literals\n' '*************************\n' '\n' 'String literals are described by the following lexical ' @@ -10266,8 +10282,7 @@ topics = {'assert': '\n' 'followed by a newline is interpreted as those two characters as ' 'part\n' 'of the literal, *not* as a line continuation.\n', - 'subscriptions': '\n' - 'Subscriptions\n' + 'subscriptions': 'Subscriptions\n' '*************\n' '\n' 'A subscription selects an item of a sequence (string, tuple ' @@ -10324,32 +10339,26 @@ topics = {'assert': '\n' "A string's items are characters. A character is not a " 'separate data\n' 'type but a string of exactly one character.\n', - 'truth': '\n' - 'Truth Value Testing\n' + 'truth': 'Truth Value Testing\n' '*******************\n' '\n' 'Any object can be tested for truth value, for use in an "if" or\n' - '"while" condition or as operand of the Boolean operations below. ' - 'The\n' - 'following values are considered false:\n' - '\n' - '* "None"\n' - '\n' - '* "False"\n' + '"while" condition or as operand of the Boolean operations below.\n' '\n' - '* zero of any numeric type, for example, "0", "0.0", "0j".\n' - '\n' - '* any empty sequence, for example, "\'\'", "()", "[]".\n' + 'By default, an object is considered true unless its class defines\n' + 'either a "__bool__()" method that returns "False" or a "__len__()"\n' + 'method that returns zero, when called with the object. [1] Here ' + 'are\n' + 'most of the built-in objects considered false:\n' '\n' - '* any empty mapping, for example, "{}".\n' + '* constants defined to be false: "None" and "False".\n' '\n' - '* instances of user-defined classes, if the class defines a\n' - ' "__bool__()" or "__len__()" method, when that method returns the\n' - ' integer zero or "bool" value "False". [1]\n' + '* zero of any numeric type: "0", "0.0", "0j", "Decimal(0)",\n' + ' "Fraction(0, 1)"\n' '\n' - 'All other values are considered true --- so objects of many types ' - 'are\n' - 'always true.\n' + '* empty sequences and collections: "\'\'", "()", "[]", "{}", ' + '"set()",\n' + ' "range(0)"\n' '\n' 'Operations and built-in functions that have a Boolean result ' 'always\n' @@ -10357,8 +10366,7 @@ topics = {'assert': '\n' 'otherwise stated. (Important exception: the Boolean operations ' '"or"\n' 'and "and" always return one of their operands.)\n', - 'try': '\n' - 'The "try" statement\n' + 'try': 'The "try" statement\n' '*******************\n' '\n' 'The "try" statement specifies exception handlers and/or cleanup code\n' @@ -10505,8 +10513,7 @@ topics = {'assert': '\n' 'Exceptions, and information on using the "raise" statement to ' 'generate\n' 'exceptions may be found in section The raise statement.\n', - 'types': '\n' - 'The standard type hierarchy\n' + 'types': 'The standard type hierarchy\n' '***************************\n' '\n' 'Below is a list of the types that are built into Python. ' @@ -10706,11 +10713,11 @@ topics = {'assert': '\n' '8-bit\n' ' bytes, represented by integers in the range 0 <= x < 256.\n' ' Bytes literals (like "b\'abc\'") and the built-in ' - 'function\n' - ' "bytes()" can be used to construct bytes objects. Also,\n' - ' bytes objects can be decoded to strings via the ' - '"decode()"\n' - ' method.\n' + '"bytes()"\n' + ' constructor can be used to create bytes objects. Also, ' + 'bytes\n' + ' objects can be decoded to strings via the "decode()" ' + 'method.\n' '\n' ' Mutable sequences\n' ' Mutable sequences can be changed after they are created. ' @@ -10736,7 +10743,7 @@ topics = {'assert': '\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' + ' the same interface and functionality as immutable "bytes"\n' ' objects.\n' '\n' ' The extension module "array" provides an additional example ' @@ -10902,7 +10909,11 @@ topics = {'assert': '\n' '| Read-only |\n' ' | | contain bindings for the ' '| |\n' - " | | function's free variables. " + " | | function's free variables. See " + '| |\n' + ' | | below for information on the ' + '| |\n' + ' | | "cell_contents" attribute. ' '| |\n' ' ' '+---------------------------+---------------------------------+-------------+\n' @@ -10941,6 +10952,9 @@ topics = {'assert': '\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' @@ -11064,6 +11078,27 @@ topics = {'assert': '\n' '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 ' + 'for"\n' + ' statement to execute the body of the function.\n' + '\n' + ' Calling the asynchronous iterator\'s "aiterator.__anext__()"\n' + ' method will return an *awaitable* which when awaited will\n' + ' execute until it provides a value using the "yield" ' + 'expression.\n' + ' When the function executes an empty "return" statement or ' + 'falls\n' + ' off the 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' + '\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' @@ -11200,14 +11235,14 @@ topics = {'assert': '\n' 'the\n' ' dictionary containing the class\'s namespace; "__bases__" is a ' 'tuple\n' - ' (possibly empty or a singleton) containing the base classes, in ' - 'the\n' - ' order of their occurrence in the base class list; "__doc__" is ' - 'the\n' - " class's documentation string, or None if undefined;\n" - ' "__annotations__" (optional) is a dictionary containing ' - '*variable\n' - ' annotations* collected during class body execution.\n' + ' containing the base classes, in the order of their occurrence ' + 'in\n' + ' the base class list; "__doc__" is the class\'s documentation ' + 'string,\n' + ' or "None" if undefined; "__annotations__" (optional) is a\n' + ' dictionary containing *variable annotations* collected during ' + 'class\n' + ' body execution.\n' '\n' 'Class instances\n' ' A class instance is created by calling a class object (see ' @@ -11363,17 +11398,26 @@ topics = {'assert': '\n' ' bytecode string of the code object).\n' '\n' ' Special writable attributes: "f_trace", if not "None", is a\n' - ' function called at the start of each source code line (this ' - 'is\n' - ' used by the debugger); "f_lineno" is the current line number ' - 'of\n' - ' the frame --- writing to this from within a trace function ' - 'jumps\n' - ' to the given line (only for the bottom-most frame). A ' - 'debugger\n' - ' can implement a Jump command (aka Set Next Statement) by ' + ' 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' + '\n' + ' "f_lineno" is the current line number of the frame --- ' 'writing\n' - ' to f_lineno.\n' + ' to this from within a trace function jumps to the given line\n' + ' (only for the bottom-most frame). A debugger can implement ' + 'a\n' + ' Jump command (aka Set Next Statement) by writing to ' + 'f_lineno.\n' '\n' ' Frame objects support one method:\n' '\n' @@ -11487,8 +11531,7 @@ topics = {'assert': '\n' ' under "User-defined methods". Class method objects are ' 'created\n' ' by the built-in "classmethod()" constructor.\n', - 'typesfunctions': '\n' - 'Functions\n' + 'typesfunctions': 'Functions\n' '*********\n' '\n' 'Function objects are created by function definitions. The ' @@ -11505,8 +11548,7 @@ topics = {'assert': '\n' 'different object types.\n' '\n' 'See Function definitions for more information.\n', - 'typesmapping': '\n' - 'Mapping Types --- "dict"\n' + 'typesmapping': 'Mapping Types --- "dict"\n' '************************\n' '\n' 'A *mapping* object maps *hashable* values to arbitrary ' @@ -11863,8 +11905,7 @@ topics = {'assert': '\n' " {'bacon'}\n" " >>> keys ^ {'sausage', 'juice'}\n" " {'juice', 'sausage', 'bacon', 'spam'}\n", - 'typesmethods': '\n' - 'Methods\n' + 'typesmethods': 'Methods\n' '*******\n' '\n' 'Methods are functions that are called using the attribute ' @@ -11921,8 +11962,7 @@ topics = {'assert': '\n' " 'my name is method'\n" '\n' 'See The standard type hierarchy for more information.\n', - 'typesmodules': '\n' - 'Modules\n' + 'typesmodules': 'Modules\n' '*******\n' '\n' 'The only special operation on a module is attribute access: ' @@ -11959,8 +11999,7 @@ topics = {'assert': '\n' 'written as\n' '"<module \'os\' from ' '\'/usr/local/lib/pythonX.Y/os.pyc\'>".\n', - 'typesseq': '\n' - 'Sequence Types --- "list", "tuple", "range"\n' + 'typesseq': 'Sequence Types --- "list", "tuple", "range"\n' '*******************************************\n' '\n' 'There are three basic sequence types: lists, tuples, and range\n' @@ -11993,7 +12032,7 @@ topics = {'assert': '\n' 'comparison operations. The "+" (concatenation) and "*" ' '(repetition)\n' 'operations have the same priority as the corresponding numeric\n' - 'operations.\n' + 'operations. [3]\n' '\n' '+----------------------------+----------------------------------+------------+\n' '| Operation | Result ' @@ -12108,9 +12147,9 @@ topics = {'assert': '\n' '\n' '3. If *i* or *j* is negative, the index is relative to the end ' 'of\n' - ' the string: "len(s) + i" or "len(s) + j" is substituted. But ' - 'note\n' - ' that "-0" is still "0".\n' + ' sequence *s*: "len(s) + i" or "len(s) + j" is substituted. ' + 'But\n' + ' note that "-0" is still "0".\n' '\n' '4. The slice of *s* from *i* to *j* is defined as the sequence ' 'of\n' @@ -12129,12 +12168,17 @@ topics = {'assert': '\n' ' (j-i)/k". In other words, the indices are "i", "i+k", ' '"i+2*k",\n' ' "i+3*k" and so on, stopping when *j* is reached (but never\n' - ' including *j*). If *i* or *j* is greater than "len(s)", use\n' - ' "len(s)". If *i* or *j* are omitted or "None", they become ' - '"end"\n' - ' values (which end depends on the sign of *k*). Note, *k* ' - 'cannot be\n' - ' zero. If *k* is "None", it is treated like "1".\n' + ' including *j*). When *k* is positive, *i* and *j* are ' + 'reduced to\n' + ' "len(s)" if they are greater. When *k* is negative, *i* and ' + '*j* are\n' + ' reduced to "len(s) - 1" if they are greater. If *i* or *j* ' + 'are\n' + ' omitted or "None", they become "end" values (which end ' + 'depends on\n' + ' the sign of *k*). Note, *k* cannot be zero. If *k* is ' + '"None", it\n' + ' is treated like "1".\n' '\n' '6. Concatenating immutable sequences always results in a new\n' ' object. This means that building up a sequence by repeated\n' @@ -12291,8 +12335,8 @@ topics = {'assert': '\n' '+--------------------------------+----------------------------------+-----------------------+\n' '| "s.remove(x)" | remove the first item from ' '*s* | (3) |\n' - '| | where "s[i] == ' - 'x" | |\n' + '| | where "s[i]" is equal to ' + '*x* | |\n' '+--------------------------------+----------------------------------+-----------------------+\n' '| "s.reverse()" | reverses the items of *s* ' 'in | (4) |\n' @@ -12379,7 +12423,7 @@ topics = {'assert': '\n' 'operations.\n' ' Lists also provide the following additional method:\n' '\n' - ' sort(*, key=None, reverse=None)\n' + ' sort(*, key=None, reverse=False)\n' '\n' ' This method sorts the list in place, using only "<" ' 'comparisons\n' @@ -12652,8 +12696,7 @@ topics = {'assert': '\n' ' * The linspace recipe shows how to implement a lazy version ' 'of\n' ' range that suitable for floating point applications.\n', - 'typesseq-mutable': '\n' - 'Mutable Sequence Types\n' + 'typesseq-mutable': 'Mutable Sequence Types\n' '**********************\n' '\n' 'The operations in the following table are defined on ' @@ -12747,8 +12790,8 @@ topics = {'assert': '\n' '+--------------------------------+----------------------------------+-----------------------+\n' '| "s.remove(x)" | remove the first item ' 'from *s* | (3) |\n' - '| | where "s[i] == ' - 'x" | |\n' + '| | where "s[i]" is equal ' + 'to *x* | |\n' '+--------------------------------+----------------------------------+-----------------------+\n' '| "s.reverse()" | reverses the items of ' '*s* in | (4) |\n' @@ -12793,8 +12836,7 @@ topics = {'assert': '\n' 'referenced multiple\n' ' times, as explained for "s * n" under Common Sequence ' 'Operations.\n', - 'unary': '\n' - 'Unary arithmetic and bitwise operations\n' + 'unary': 'Unary arithmetic and bitwise operations\n' '***************************************\n' '\n' 'All unary arithmetic and bitwise operations have the same ' @@ -12816,8 +12858,7 @@ topics = {'assert': '\n' 'In all three cases, if the argument does not have the proper type, ' 'a\n' '"TypeError" exception is raised.\n', - 'while': '\n' - 'The "while" statement\n' + 'while': 'The "while" statement\n' '*********************\n' '\n' 'The "while" statement is used for repeated execution as long as an\n' @@ -12841,8 +12882,7 @@ topics = {'assert': '\n' 'executed in the first suite skips the rest of the suite and goes ' 'back\n' 'to testing the expression.\n', - 'with': '\n' - 'The "with" statement\n' + 'with': 'The "with" statement\n' '********************\n' '\n' 'The "with" statement is used to wrap the execution of a block with\n' @@ -12915,8 +12955,7 @@ topics = {'assert': '\n' ' The specification, background, and examples for the Python ' '"with"\n' ' statement.\n', - 'yield': '\n' - 'The "yield" statement\n' + 'yield': 'The "yield" statement\n' '*********************\n' '\n' ' yield_stmt ::= yield_expression\n' |