mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
Python 3.9.10
This commit is contained in:
parent
537f16adfa
commit
f2f3f53782
59 changed files with 987 additions and 360 deletions
|
|
@ -18,12 +18,12 @@
|
||||||
/*--start constants--*/
|
/*--start constants--*/
|
||||||
#define PY_MAJOR_VERSION 3
|
#define PY_MAJOR_VERSION 3
|
||||||
#define PY_MINOR_VERSION 9
|
#define PY_MINOR_VERSION 9
|
||||||
#define PY_MICRO_VERSION 9
|
#define PY_MICRO_VERSION 10
|
||||||
#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL
|
#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL
|
||||||
#define PY_RELEASE_SERIAL 0
|
#define PY_RELEASE_SERIAL 0
|
||||||
|
|
||||||
/* Version as a string */
|
/* Version as a string */
|
||||||
#define PY_VERSION "3.9.9+"
|
#define PY_VERSION "3.9.10"
|
||||||
/*--end constants--*/
|
/*--end constants--*/
|
||||||
|
|
||||||
/* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2.
|
/* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2.
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Autogenerated by Sphinx on Mon Nov 15 18:21:10 2021
|
# Autogenerated by Sphinx on Thu Jan 13 21:46:32 2022
|
||||||
topics = {'assert': 'The "assert" statement\n'
|
topics = {'assert': 'The "assert" statement\n'
|
||||||
'**********************\n'
|
'**********************\n'
|
||||||
'\n'
|
'\n'
|
||||||
|
|
@ -979,7 +979,7 @@
|
||||||
'"super(B,\n'
|
'"super(B,\n'
|
||||||
' obj).m()" searches "obj.__class__.__mro__" for the '
|
' obj).m()" searches "obj.__class__.__mro__" for the '
|
||||||
'base class "A"\n'
|
'base class "A"\n'
|
||||||
' immediately preceding "B" and then invokes the '
|
' immediately following "B" and then invokes the '
|
||||||
'descriptor with the\n'
|
'descriptor with the\n'
|
||||||
' call: "A.__dict__[\'m\'].__get__(obj, '
|
' call: "A.__dict__[\'m\'].__get__(obj, '
|
||||||
'obj.__class__)".\n'
|
'obj.__class__)".\n'
|
||||||
|
|
@ -1010,14 +1010,15 @@
|
||||||
'can be\n'
|
'can be\n'
|
||||||
'overridden by instances.\n'
|
'overridden by instances.\n'
|
||||||
'\n'
|
'\n'
|
||||||
'Python methods (including "staticmethod()" and '
|
'Python methods (including those decorated with '
|
||||||
'"classmethod()") are\n'
|
'"@staticmethod" and\n'
|
||||||
'implemented as non-data descriptors. Accordingly, '
|
'"@classmethod") are implemented as non-data '
|
||||||
'instances can\n'
|
'descriptors. Accordingly,\n'
|
||||||
'redefine and override methods. This allows individual '
|
'instances can redefine and override methods. This '
|
||||||
'instances to\n'
|
'allows individual\n'
|
||||||
'acquire behaviors that differ from other instances of '
|
'instances to acquire behaviors that differ from other '
|
||||||
'the same class.\n'
|
'instances of the\n'
|
||||||
|
'same class.\n'
|
||||||
'\n'
|
'\n'
|
||||||
'The "property()" function is implemented as a data '
|
'The "property()" function is implemented as a data '
|
||||||
'descriptor.\n'
|
'descriptor.\n'
|
||||||
|
|
@ -1030,12 +1031,12 @@
|
||||||
'\n'
|
'\n'
|
||||||
'*__slots__* allow us to explicitly declare data members '
|
'*__slots__* allow us to explicitly declare data members '
|
||||||
'(like\n'
|
'(like\n'
|
||||||
'properties) and deny the creation of *__dict__* and '
|
'properties) and deny the creation of "__dict__" and '
|
||||||
'*__weakref__*\n'
|
'*__weakref__*\n'
|
||||||
'(unless explicitly declared in *__slots__* or available '
|
'(unless explicitly declared in *__slots__* or available '
|
||||||
'in a parent.)\n'
|
'in a parent.)\n'
|
||||||
'\n'
|
'\n'
|
||||||
'The space saved over using *__dict__* can be '
|
'The space saved over using "__dict__" can be '
|
||||||
'significant. Attribute\n'
|
'significant. Attribute\n'
|
||||||
'lookup speed can be significantly improved as well.\n'
|
'lookup speed can be significantly improved as well.\n'
|
||||||
'\n'
|
'\n'
|
||||||
|
|
@ -1047,7 +1048,7 @@
|
||||||
'*__slots__*\n'
|
'*__slots__*\n'
|
||||||
' reserves space for the declared variables and '
|
' reserves space for the declared variables and '
|
||||||
'prevents the\n'
|
'prevents the\n'
|
||||||
' automatic creation of *__dict__* and *__weakref__* '
|
' automatic creation of "__dict__" and *__weakref__* '
|
||||||
'for each\n'
|
'for each\n'
|
||||||
' instance.\n'
|
' instance.\n'
|
||||||
'\n'
|
'\n'
|
||||||
|
|
@ -1056,11 +1057,11 @@
|
||||||
'--------------------------\n'
|
'--------------------------\n'
|
||||||
'\n'
|
'\n'
|
||||||
'* When inheriting from a class without *__slots__*, the '
|
'* When inheriting from a class without *__slots__*, the '
|
||||||
'*__dict__* and\n'
|
'"__dict__" and\n'
|
||||||
' *__weakref__* attribute of the instances will always '
|
' *__weakref__* attribute of the instances will always '
|
||||||
'be accessible.\n'
|
'be accessible.\n'
|
||||||
'\n'
|
'\n'
|
||||||
'* Without a *__dict__* variable, instances cannot be '
|
'* Without a "__dict__" variable, instances cannot be '
|
||||||
'assigned new\n'
|
'assigned new\n'
|
||||||
' variables not listed in the *__slots__* definition. '
|
' variables not listed in the *__slots__* definition. '
|
||||||
'Attempts to\n'
|
'Attempts to\n'
|
||||||
|
|
@ -1074,28 +1075,28 @@
|
||||||
'\n'
|
'\n'
|
||||||
'* Without a *__weakref__* variable for each instance, '
|
'* Without a *__weakref__* variable for each instance, '
|
||||||
'classes defining\n'
|
'classes defining\n'
|
||||||
' *__slots__* do not support weak references to its '
|
' *__slots__* do not support "weak references" to its '
|
||||||
'instances. If weak\n'
|
'instances. If\n'
|
||||||
' reference support is needed, then add '
|
' weak reference support is needed, then add '
|
||||||
'"\'__weakref__\'" to the\n'
|
'"\'__weakref__\'" to the\n'
|
||||||
' sequence of strings in the *__slots__* declaration.\n'
|
' sequence of strings in the *__slots__* declaration.\n'
|
||||||
'\n'
|
'\n'
|
||||||
'* *__slots__* are implemented at the class level by '
|
'* *__slots__* are implemented at the class level by '
|
||||||
'creating\n'
|
'creating\n'
|
||||||
' descriptors (Implementing Descriptors) for each '
|
' descriptors for each variable name. As a result, '
|
||||||
'variable name. As a\n'
|
'class attributes\n'
|
||||||
' result, class attributes cannot be used to set default '
|
' cannot be used to set default values for instance '
|
||||||
'values for\n'
|
'variables defined\n'
|
||||||
' instance variables defined by *__slots__*; otherwise, '
|
' by *__slots__*; otherwise, the class attribute would '
|
||||||
'the class\n'
|
'overwrite the\n'
|
||||||
' attribute would overwrite the descriptor assignment.\n'
|
' descriptor assignment.\n'
|
||||||
'\n'
|
'\n'
|
||||||
'* The action of a *__slots__* declaration is not limited '
|
'* The action of a *__slots__* declaration is not limited '
|
||||||
'to the class\n'
|
'to the class\n'
|
||||||
' where it is defined. *__slots__* declared in parents '
|
' where it is defined. *__slots__* declared in parents '
|
||||||
'are available\n'
|
'are available\n'
|
||||||
' in child classes. However, child subclasses will get a '
|
' in child classes. However, child subclasses will get a '
|
||||||
'*__dict__*\n'
|
'"__dict__"\n'
|
||||||
' and *__weakref__* unless they also define *__slots__* '
|
' and *__weakref__* unless they also define *__slots__* '
|
||||||
'(which should\n'
|
'(which should\n'
|
||||||
' only contain names of any *additional* slots).\n'
|
' only contain names of any *additional* slots).\n'
|
||||||
|
|
@ -1115,13 +1116,19 @@
|
||||||
' “variable-length” built-in types such as "int", '
|
' “variable-length” built-in types such as "int", '
|
||||||
'"bytes" and "tuple".\n'
|
'"bytes" and "tuple".\n'
|
||||||
'\n'
|
'\n'
|
||||||
'* Any non-string iterable may be assigned to '
|
'* Any non-string *iterable* may be assigned to '
|
||||||
'*__slots__*. Mappings may\n'
|
'*__slots__*.\n'
|
||||||
' also be used; however, in the future, special meaning '
|
|
||||||
'may be\n'
|
|
||||||
' assigned to the values corresponding to each key.\n'
|
|
||||||
'\n'
|
'\n'
|
||||||
'* *__class__* assignment works only if both classes have '
|
'* If a "dictionary" is used to assign *__slots__*, the '
|
||||||
|
'dictionary keys\n'
|
||||||
|
' will be used as the slot names. The values of the '
|
||||||
|
'dictionary can be\n'
|
||||||
|
' used to provide per-attribute docstrings that will be '
|
||||||
|
'recognised by\n'
|
||||||
|
' "inspect.getdoc()" and displayed in the output of '
|
||||||
|
'"help()".\n'
|
||||||
|
'\n'
|
||||||
|
'* "__class__" assignment works only if both classes have '
|
||||||
'the same\n'
|
'the same\n'
|
||||||
' *__slots__*.\n'
|
' *__slots__*.\n'
|
||||||
'\n'
|
'\n'
|
||||||
|
|
@ -1133,10 +1140,10 @@
|
||||||
'violations\n'
|
'violations\n'
|
||||||
' raise "TypeError".\n'
|
' raise "TypeError".\n'
|
||||||
'\n'
|
'\n'
|
||||||
'* If an iterator is used for *__slots__* then a '
|
'* If an *iterator* is used for *__slots__* then a '
|
||||||
'descriptor is created\n'
|
'*descriptor* is\n'
|
||||||
' for each of the iterator’s values. However, the '
|
' created for each of the iterator’s values. However, '
|
||||||
'*__slots__*\n'
|
'the *__slots__*\n'
|
||||||
' attribute will be an empty iterator.\n',
|
' attribute will be an empty iterator.\n',
|
||||||
'attribute-references': 'Attribute references\n'
|
'attribute-references': 'Attribute references\n'
|
||||||
'********************\n'
|
'********************\n'
|
||||||
|
|
@ -3763,17 +3770,16 @@
|
||||||
'debugger will pause execution just before the first line of the\n'
|
'debugger will pause execution just before the first line of the\n'
|
||||||
'module.\n'
|
'module.\n'
|
||||||
'\n'
|
'\n'
|
||||||
'The typical usage to break into the debugger from a running '
|
'The typical usage to break into the debugger is to insert:\n'
|
||||||
'program is\n'
|
|
||||||
'to insert\n'
|
|
||||||
'\n'
|
'\n'
|
||||||
' import pdb; pdb.set_trace()\n'
|
' import pdb; pdb.set_trace()\n'
|
||||||
'\n'
|
'\n'
|
||||||
'at the location you want to break into the debugger. You can '
|
'at the location you want to break into the debugger, and then '
|
||||||
'then\n'
|
'run the\n'
|
||||||
'step through the code following this statement, and continue '
|
'program. You can then step through the code following this '
|
||||||
'running\n'
|
'statement,\n'
|
||||||
'without the debugger using the "continue" command.\n'
|
'and continue running without the debugger using the "continue"\n'
|
||||||
|
'command.\n'
|
||||||
'\n'
|
'\n'
|
||||||
'New in version 3.7: The built-in "breakpoint()", when called '
|
'New in version 3.7: The built-in "breakpoint()", when called '
|
||||||
'with\n'
|
'with\n'
|
||||||
|
|
@ -7655,61 +7661,62 @@
|
||||||
'\n'
|
'\n'
|
||||||
'The following methods can be defined to implement '
|
'The following methods can be defined to implement '
|
||||||
'container objects.\n'
|
'container objects.\n'
|
||||||
'Containers usually are sequences (such as lists or tuples) '
|
'Containers usually are *sequences* (such as "lists" or '
|
||||||
'or mappings\n'
|
'"tuples") or\n'
|
||||||
'(like dictionaries), but can represent other containers as '
|
'*mappings* (like "dictionaries"), but can represent other '
|
||||||
'well. The\n'
|
'containers\n'
|
||||||
'first set of methods is used either to emulate a sequence '
|
'as well. The first set of methods is used either to '
|
||||||
'or to\n'
|
'emulate a\n'
|
||||||
'emulate a mapping; the difference is that for a sequence, '
|
'sequence or to emulate a mapping; the difference is that '
|
||||||
'the\n'
|
'for a\n'
|
||||||
'allowable keys should be the integers *k* for which "0 <= '
|
'sequence, the allowable keys should be the integers *k* '
|
||||||
'k < N" where\n'
|
'for which "0\n'
|
||||||
'*N* is the length of the sequence, or slice objects, which '
|
'<= k < N" where *N* is the length of the sequence, or '
|
||||||
'define a\n'
|
'"slice" objects,\n'
|
||||||
'range of items. It is also recommended that mappings '
|
'which define a range of items. It is also recommended '
|
||||||
'provide the\n'
|
'that mappings\n'
|
||||||
'methods "keys()", "values()", "items()", "get()", '
|
'provide the methods "keys()", "values()", "items()", '
|
||||||
'"clear()",\n'
|
'"get()",\n'
|
||||||
'"setdefault()", "pop()", "popitem()", "copy()", and '
|
'"clear()", "setdefault()", "pop()", "popitem()", "copy()", '
|
||||||
'"update()"\n'
|
'and\n'
|
||||||
'behaving similar to those for Python’s standard dictionary '
|
'"update()" behaving similar to those for Python’s '
|
||||||
|
'standard\n'
|
||||||
|
'"dictionary" objects. The "collections.abc" module '
|
||||||
|
'provides a\n'
|
||||||
|
'"MutableMapping" *abstract base class* to help create '
|
||||||
|
'those methods\n'
|
||||||
|
'from a base set of "__getitem__()", "__setitem__()", '
|
||||||
|
'"__delitem__()",\n'
|
||||||
|
'and "keys()". Mutable sequences should provide methods '
|
||||||
|
'"append()",\n'
|
||||||
|
'"count()", "index()", "extend()", "insert()", "pop()", '
|
||||||
|
'"remove()",\n'
|
||||||
|
'"reverse()" and "sort()", like Python standard "list" '
|
||||||
'objects.\n'
|
'objects.\n'
|
||||||
'The "collections.abc" module provides a "MutableMapping" '
|
'Finally, sequence types should implement addition '
|
||||||
'abstract base\n'
|
|
||||||
'class to help create those methods from a base set of '
|
|
||||||
'"__getitem__()",\n'
|
|
||||||
'"__setitem__()", "__delitem__()", and "keys()". Mutable '
|
|
||||||
'sequences\n'
|
|
||||||
'should provide methods "append()", "count()", "index()", '
|
|
||||||
'"extend()",\n'
|
|
||||||
'"insert()", "pop()", "remove()", "reverse()" and "sort()", '
|
|
||||||
'like Python\n'
|
|
||||||
'standard list objects. Finally, sequence types should '
|
|
||||||
'implement\n'
|
|
||||||
'addition (meaning concatenation) and multiplication '
|
|
||||||
'(meaning\n'
|
'(meaning\n'
|
||||||
'repetition) by defining the methods "__add__()", '
|
'concatenation) and multiplication (meaning repetition) by '
|
||||||
'"__radd__()",\n'
|
'defining the\n'
|
||||||
'"__iadd__()", "__mul__()", "__rmul__()" and "__imul__()" '
|
'methods "__add__()", "__radd__()", "__iadd__()", '
|
||||||
'described\n'
|
'"__mul__()",\n'
|
||||||
'below; they should not define other numerical operators. '
|
'"__rmul__()" and "__imul__()" described below; they should '
|
||||||
|
'not define\n'
|
||||||
|
'other numerical operators. It is recommended that both '
|
||||||
|
'mappings and\n'
|
||||||
|
'sequences implement the "__contains__()" method to allow '
|
||||||
|
'efficient use\n'
|
||||||
|
'of the "in" operator; for mappings, "in" should search the '
|
||||||
|
'mapping’s\n'
|
||||||
|
'keys; for sequences, it should search through the values. '
|
||||||
'It is\n'
|
'It is\n'
|
||||||
'recommended that both mappings and sequences implement '
|
'further recommended that both mappings and sequences '
|
||||||
|
'implement the\n'
|
||||||
|
'"__iter__()" method to allow efficient iteration through '
|
||||||
'the\n'
|
'the\n'
|
||||||
'"__contains__()" method to allow efficient use of the "in" '
|
'container; for mappings, "__iter__()" should iterate '
|
||||||
'operator;\n'
|
'through the\n'
|
||||||
'for mappings, "in" should search the mapping’s keys; for '
|
'object’s keys; for sequences, it should iterate through '
|
||||||
'sequences, it\n'
|
'the values.\n'
|
||||||
'should search through the values. It is further '
|
|
||||||
'recommended that both\n'
|
|
||||||
'mappings and sequences implement the "__iter__()" method '
|
|
||||||
'to allow\n'
|
|
||||||
'efficient iteration through the container; for mappings, '
|
|
||||||
'"__iter__()"\n'
|
|
||||||
'should iterate through the object’s keys; for sequences, '
|
|
||||||
'it should\n'
|
|
||||||
'iterate through the values.\n'
|
|
||||||
'\n'
|
'\n'
|
||||||
'object.__len__(self)\n'
|
'object.__len__(self)\n'
|
||||||
'\n'
|
'\n'
|
||||||
|
|
@ -7768,22 +7775,24 @@
|
||||||
'object.__getitem__(self, key)\n'
|
'object.__getitem__(self, key)\n'
|
||||||
'\n'
|
'\n'
|
||||||
' Called to implement evaluation of "self[key]". For '
|
' Called to implement evaluation of "self[key]". For '
|
||||||
'sequence types,\n'
|
'*sequence*\n'
|
||||||
' the accepted keys should be integers and slice '
|
' types, the accepted keys should be integers and slice '
|
||||||
'objects. Note that\n'
|
'objects.\n'
|
||||||
' the special interpretation of negative indexes (if the '
|
' Note that the special interpretation of negative '
|
||||||
'class wishes\n'
|
'indexes (if the\n'
|
||||||
' to emulate a sequence type) is up to the '
|
' class wishes to emulate a *sequence* type) is up to '
|
||||||
'"__getitem__()" method. If\n'
|
|
||||||
' *key* is of an inappropriate type, "TypeError" may be '
|
|
||||||
'raised; if of\n'
|
|
||||||
' a value outside the set of indexes for the sequence '
|
|
||||||
'(after any\n'
|
|
||||||
' special interpretation of negative values), '
|
|
||||||
'"IndexError" should be\n'
|
|
||||||
' raised. For mapping types, if *key* is missing (not in '
|
|
||||||
'the\n'
|
'the\n'
|
||||||
' container), "KeyError" should be raised.\n'
|
' "__getitem__()" method. If *key* is of an inappropriate '
|
||||||
|
'type,\n'
|
||||||
|
' "TypeError" may be raised; if of a value outside the '
|
||||||
|
'set of indexes\n'
|
||||||
|
' for the sequence (after any special interpretation of '
|
||||||
|
'negative\n'
|
||||||
|
' values), "IndexError" should be raised. For *mapping* '
|
||||||
|
'types, if\n'
|
||||||
|
' *key* is missing (not in the container), "KeyError" '
|
||||||
|
'should be\n'
|
||||||
|
' raised.\n'
|
||||||
'\n'
|
'\n'
|
||||||
' Note:\n'
|
' Note:\n'
|
||||||
'\n'
|
'\n'
|
||||||
|
|
@ -7793,6 +7802,15 @@
|
||||||
'of the\n'
|
'of the\n'
|
||||||
' sequence.\n'
|
' sequence.\n'
|
||||||
'\n'
|
'\n'
|
||||||
|
' Note:\n'
|
||||||
|
'\n'
|
||||||
|
' When subscripting a *class*, the special class '
|
||||||
|
'method\n'
|
||||||
|
' "__class_getitem__()" may be called instead of '
|
||||||
|
'"__getitem__()".\n'
|
||||||
|
' See __class_getitem__ versus __getitem__ for more '
|
||||||
|
'details.\n'
|
||||||
|
'\n'
|
||||||
'object.__setitem__(self, key, value)\n'
|
'object.__setitem__(self, key, value)\n'
|
||||||
'\n'
|
'\n'
|
||||||
' Called to implement assignment to "self[key]". Same '
|
' Called to implement assignment to "self[key]". Same '
|
||||||
|
|
@ -8891,7 +8909,7 @@
|
||||||
'"super(B,\n'
|
'"super(B,\n'
|
||||||
' obj).m()" searches "obj.__class__.__mro__" for the base '
|
' obj).m()" searches "obj.__class__.__mro__" for the base '
|
||||||
'class "A"\n'
|
'class "A"\n'
|
||||||
' immediately preceding "B" and then invokes the descriptor '
|
' immediately following "B" and then invokes the descriptor '
|
||||||
'with the\n'
|
'with the\n'
|
||||||
' call: "A.__dict__[\'m\'].__get__(obj, obj.__class__)".\n'
|
' call: "A.__dict__[\'m\'].__get__(obj, obj.__class__)".\n'
|
||||||
'\n'
|
'\n'
|
||||||
|
|
@ -8921,13 +8939,14 @@
|
||||||
'be\n'
|
'be\n'
|
||||||
'overridden by instances.\n'
|
'overridden by instances.\n'
|
||||||
'\n'
|
'\n'
|
||||||
'Python methods (including "staticmethod()" and '
|
'Python methods (including those decorated with '
|
||||||
'"classmethod()") are\n'
|
'"@staticmethod" and\n'
|
||||||
'implemented as non-data descriptors. Accordingly, instances '
|
'"@classmethod") are implemented as non-data descriptors. '
|
||||||
'can\n'
|
'Accordingly,\n'
|
||||||
'redefine and override methods. This allows individual '
|
'instances can redefine and override methods. This allows '
|
||||||
'instances to\n'
|
'individual\n'
|
||||||
'acquire behaviors that differ from other instances of the '
|
'instances to acquire behaviors that differ from other '
|
||||||
|
'instances of the\n'
|
||||||
'same class.\n'
|
'same class.\n'
|
||||||
'\n'
|
'\n'
|
||||||
'The "property()" function is implemented as a data '
|
'The "property()" function is implemented as a data '
|
||||||
|
|
@ -8941,12 +8960,12 @@
|
||||||
'\n'
|
'\n'
|
||||||
'*__slots__* allow us to explicitly declare data members '
|
'*__slots__* allow us to explicitly declare data members '
|
||||||
'(like\n'
|
'(like\n'
|
||||||
'properties) and deny the creation of *__dict__* and '
|
'properties) and deny the creation of "__dict__" and '
|
||||||
'*__weakref__*\n'
|
'*__weakref__*\n'
|
||||||
'(unless explicitly declared in *__slots__* or available in a '
|
'(unless explicitly declared in *__slots__* or available in a '
|
||||||
'parent.)\n'
|
'parent.)\n'
|
||||||
'\n'
|
'\n'
|
||||||
'The space saved over using *__dict__* can be significant. '
|
'The space saved over using "__dict__" can be significant. '
|
||||||
'Attribute\n'
|
'Attribute\n'
|
||||||
'lookup speed can be significantly improved as well.\n'
|
'lookup speed can be significantly improved as well.\n'
|
||||||
'\n'
|
'\n'
|
||||||
|
|
@ -8958,7 +8977,7 @@
|
||||||
'*__slots__*\n'
|
'*__slots__*\n'
|
||||||
' reserves space for the declared variables and prevents '
|
' reserves space for the declared variables and prevents '
|
||||||
'the\n'
|
'the\n'
|
||||||
' automatic creation of *__dict__* and *__weakref__* for '
|
' automatic creation of "__dict__" and *__weakref__* for '
|
||||||
'each\n'
|
'each\n'
|
||||||
' instance.\n'
|
' instance.\n'
|
||||||
'\n'
|
'\n'
|
||||||
|
|
@ -8967,11 +8986,11 @@
|
||||||
'~~~~~~~~~~~~~~~~~~~~~~~~~~\n'
|
'~~~~~~~~~~~~~~~~~~~~~~~~~~\n'
|
||||||
'\n'
|
'\n'
|
||||||
'* When inheriting from a class without *__slots__*, the '
|
'* When inheriting from a class without *__slots__*, the '
|
||||||
'*__dict__* and\n'
|
'"__dict__" and\n'
|
||||||
' *__weakref__* attribute of the instances will always be '
|
' *__weakref__* attribute of the instances will always be '
|
||||||
'accessible.\n'
|
'accessible.\n'
|
||||||
'\n'
|
'\n'
|
||||||
'* Without a *__dict__* variable, instances cannot be '
|
'* Without a "__dict__" variable, instances cannot be '
|
||||||
'assigned new\n'
|
'assigned new\n'
|
||||||
' variables not listed in the *__slots__* definition. '
|
' variables not listed in the *__slots__* definition. '
|
||||||
'Attempts to\n'
|
'Attempts to\n'
|
||||||
|
|
@ -8984,28 +9003,28 @@
|
||||||
'\n'
|
'\n'
|
||||||
'* Without a *__weakref__* variable for each instance, '
|
'* Without a *__weakref__* variable for each instance, '
|
||||||
'classes defining\n'
|
'classes defining\n'
|
||||||
' *__slots__* do not support weak references to its '
|
' *__slots__* do not support "weak references" to its '
|
||||||
'instances. If weak\n'
|
'instances. If\n'
|
||||||
' reference support is needed, then add "\'__weakref__\'" to '
|
' weak reference support is needed, then add '
|
||||||
'the\n'
|
'"\'__weakref__\'" to the\n'
|
||||||
' sequence of strings in the *__slots__* declaration.\n'
|
' sequence of strings in the *__slots__* declaration.\n'
|
||||||
'\n'
|
'\n'
|
||||||
'* *__slots__* are implemented at the class level by '
|
'* *__slots__* are implemented at the class level by '
|
||||||
'creating\n'
|
'creating\n'
|
||||||
' descriptors (Implementing Descriptors) for each variable '
|
' descriptors for each variable name. As a result, class '
|
||||||
'name. As a\n'
|
'attributes\n'
|
||||||
' result, class attributes cannot be used to set default '
|
' cannot be used to set default values for instance '
|
||||||
'values for\n'
|
'variables defined\n'
|
||||||
' instance variables defined by *__slots__*; otherwise, the '
|
' by *__slots__*; otherwise, the class attribute would '
|
||||||
'class\n'
|
'overwrite the\n'
|
||||||
' attribute would overwrite the descriptor assignment.\n'
|
' descriptor assignment.\n'
|
||||||
'\n'
|
'\n'
|
||||||
'* The action of a *__slots__* declaration is not limited to '
|
'* The action of a *__slots__* declaration is not limited to '
|
||||||
'the class\n'
|
'the class\n'
|
||||||
' where it is defined. *__slots__* declared in parents are '
|
' where it is defined. *__slots__* declared in parents are '
|
||||||
'available\n'
|
'available\n'
|
||||||
' in child classes. However, child subclasses will get a '
|
' in child classes. However, child subclasses will get a '
|
||||||
'*__dict__*\n'
|
'"__dict__"\n'
|
||||||
' and *__weakref__* unless they also define *__slots__* '
|
' and *__weakref__* unless they also define *__slots__* '
|
||||||
'(which should\n'
|
'(which should\n'
|
||||||
' only contain names of any *additional* slots).\n'
|
' only contain names of any *additional* slots).\n'
|
||||||
|
|
@ -9025,13 +9044,18 @@
|
||||||
' “variable-length” built-in types such as "int", "bytes" '
|
' “variable-length” built-in types such as "int", "bytes" '
|
||||||
'and "tuple".\n'
|
'and "tuple".\n'
|
||||||
'\n'
|
'\n'
|
||||||
'* Any non-string iterable may be assigned to *__slots__*. '
|
'* Any non-string *iterable* may be assigned to *__slots__*.\n'
|
||||||
'Mappings may\n'
|
|
||||||
' also be used; however, in the future, special meaning may '
|
|
||||||
'be\n'
|
|
||||||
' assigned to the values corresponding to each key.\n'
|
|
||||||
'\n'
|
'\n'
|
||||||
'* *__class__* assignment works only if both classes have the '
|
'* If a "dictionary" is used to assign *__slots__*, the '
|
||||||
|
'dictionary keys\n'
|
||||||
|
' will be used as the slot names. The values of the '
|
||||||
|
'dictionary can be\n'
|
||||||
|
' used to provide per-attribute docstrings that will be '
|
||||||
|
'recognised by\n'
|
||||||
|
' "inspect.getdoc()" and displayed in the output of '
|
||||||
|
'"help()".\n'
|
||||||
|
'\n'
|
||||||
|
'* "__class__" assignment works only if both classes have the '
|
||||||
'same\n'
|
'same\n'
|
||||||
' *__slots__*.\n'
|
' *__slots__*.\n'
|
||||||
'\n'
|
'\n'
|
||||||
|
|
@ -9043,9 +9067,9 @@
|
||||||
'violations\n'
|
'violations\n'
|
||||||
' raise "TypeError".\n'
|
' raise "TypeError".\n'
|
||||||
'\n'
|
'\n'
|
||||||
'* If an iterator is used for *__slots__* then a descriptor '
|
'* If an *iterator* is used for *__slots__* then a '
|
||||||
'is created\n'
|
'*descriptor* is\n'
|
||||||
' for each of the iterator’s values. However, the '
|
' created for each of the iterator’s values. However, the '
|
||||||
'*__slots__*\n'
|
'*__slots__*\n'
|
||||||
' attribute will be an empty iterator.\n'
|
' attribute will be an empty iterator.\n'
|
||||||
'\n'
|
'\n'
|
||||||
|
|
@ -9054,7 +9078,7 @@
|
||||||
'==========================\n'
|
'==========================\n'
|
||||||
'\n'
|
'\n'
|
||||||
'Whenever a class inherits from another class, '
|
'Whenever a class inherits from another class, '
|
||||||
'*__init_subclass__* is\n'
|
'"__init_subclass__()" is\n'
|
||||||
'called on that class. This way, it is possible to write '
|
'called on that class. This way, it is possible to write '
|
||||||
'classes which\n'
|
'classes which\n'
|
||||||
'change the behavior of subclasses. This is closely related '
|
'change the behavior of subclasses. This is closely related '
|
||||||
|
|
@ -9222,10 +9246,10 @@
|
||||||
'come from\n'
|
'come from\n'
|
||||||
'the class definition). The "__prepare__" method should be '
|
'the class definition). The "__prepare__" method should be '
|
||||||
'implemented\n'
|
'implemented\n'
|
||||||
'as a "classmethod()". The namespace returned by '
|
'as a "classmethod". The namespace returned by "__prepare__" '
|
||||||
'"__prepare__" is\n'
|
'is passed\n'
|
||||||
'passed in to "__new__", but when the final class object is '
|
'in to "__new__", but when the final class object is created '
|
||||||
'created the\n'
|
'the\n'
|
||||||
'namespace is copied into a new "dict".\n'
|
'namespace is copied into a new "dict".\n'
|
||||||
'\n'
|
'\n'
|
||||||
'If the metaclass has no "__prepare__" attribute, then the '
|
'If the metaclass has no "__prepare__" attribute, then the '
|
||||||
|
|
@ -9413,9 +9437,33 @@
|
||||||
'Emulating generic types\n'
|
'Emulating generic types\n'
|
||||||
'=======================\n'
|
'=======================\n'
|
||||||
'\n'
|
'\n'
|
||||||
'One can implement the generic class syntax as specified by '
|
'When using *type annotations*, it is often useful to '
|
||||||
'**PEP 484**\n'
|
'*parameterize* a\n'
|
||||||
'(for example "List[int]") by defining a special method:\n'
|
'*generic type* using Python’s square-brackets notation. For '
|
||||||
|
'example,\n'
|
||||||
|
'the annotation "list[int]" might be used to signify a "list" '
|
||||||
|
'in which\n'
|
||||||
|
'all the elements are of type "int".\n'
|
||||||
|
'\n'
|
||||||
|
'See also:\n'
|
||||||
|
'\n'
|
||||||
|
' **PEP 484** - Type Hints\n'
|
||||||
|
' Introducing Python’s framework for type annotations\n'
|
||||||
|
'\n'
|
||||||
|
' Generic Alias Types\n'
|
||||||
|
' Documentation for objects representing parameterized '
|
||||||
|
'generic\n'
|
||||||
|
' classes\n'
|
||||||
|
'\n'
|
||||||
|
' Generics, user-defined generics and "typing.Generic"\n'
|
||||||
|
' Documentation on how to implement generic classes that '
|
||||||
|
'can be\n'
|
||||||
|
' parameterized at runtime and understood by static '
|
||||||
|
'type-checkers.\n'
|
||||||
|
'\n'
|
||||||
|
'A class can *generally* only be parameterized if it defines '
|
||||||
|
'the\n'
|
||||||
|
'special class method "__class_getitem__()".\n'
|
||||||
'\n'
|
'\n'
|
||||||
'classmethod object.__class_getitem__(cls, key)\n'
|
'classmethod object.__class_getitem__(cls, key)\n'
|
||||||
'\n'
|
'\n'
|
||||||
|
|
@ -9423,18 +9471,144 @@
|
||||||
'generic class\n'
|
'generic class\n'
|
||||||
' by type arguments found in *key*.\n'
|
' by type arguments found in *key*.\n'
|
||||||
'\n'
|
'\n'
|
||||||
'This method is looked up on the class object itself, and '
|
' When defined on a class, "__class_getitem__()" is '
|
||||||
'when defined\n'
|
'automatically a\n'
|
||||||
'in the class body, this method is implicitly a class '
|
' class method. As such, there is no need for it to be '
|
||||||
'method. Note,\n'
|
'decorated with\n'
|
||||||
'this mechanism is primarily reserved for use with static '
|
' "@classmethod" when it is defined.\n'
|
||||||
'type hints,\n'
|
'\n'
|
||||||
'other usage is discouraged.\n'
|
'\n'
|
||||||
|
'The purpose of *__class_getitem__*\n'
|
||||||
|
'----------------------------------\n'
|
||||||
|
'\n'
|
||||||
|
'The purpose of "__class_getitem__()" is to allow runtime\n'
|
||||||
|
'parameterization of standard-library generic classes in '
|
||||||
|
'order to more\n'
|
||||||
|
'easily apply *type hints* to these classes.\n'
|
||||||
|
'\n'
|
||||||
|
'To implement custom generic classes that can be '
|
||||||
|
'parameterized at\n'
|
||||||
|
'runtime and understood by static type-checkers, users should '
|
||||||
|
'either\n'
|
||||||
|
'inherit from a standard library class that already '
|
||||||
|
'implements\n'
|
||||||
|
'"__class_getitem__()", or inherit from "typing.Generic", '
|
||||||
|
'which has its\n'
|
||||||
|
'own implementation of "__class_getitem__()".\n'
|
||||||
|
'\n'
|
||||||
|
'Custom implementations of "__class_getitem__()" on classes '
|
||||||
|
'defined\n'
|
||||||
|
'outside of the standard library may not be understood by '
|
||||||
|
'third-party\n'
|
||||||
|
'type-checkers such as mypy. Using "__class_getitem__()" on '
|
||||||
|
'any class\n'
|
||||||
|
'for purposes other than type hinting is discouraged.\n'
|
||||||
|
'\n'
|
||||||
|
'\n'
|
||||||
|
'*__class_getitem__* versus *__getitem__*\n'
|
||||||
|
'----------------------------------------\n'
|
||||||
|
'\n'
|
||||||
|
'Usually, the subscription of an object using square brackets '
|
||||||
|
'will call\n'
|
||||||
|
'the "__getitem__()" instance method defined on the object’s '
|
||||||
|
'class.\n'
|
||||||
|
'However, if the object being subscribed is itself a class, '
|
||||||
|
'the class\n'
|
||||||
|
'method "__class_getitem__()" may be called instead.\n'
|
||||||
|
'"__class_getitem__()" should return a GenericAlias object if '
|
||||||
|
'it is\n'
|
||||||
|
'properly defined.\n'
|
||||||
|
'\n'
|
||||||
|
'Presented with the *expression* "obj[x]", the Python '
|
||||||
|
'interpreter\n'
|
||||||
|
'follows something like the following process to decide '
|
||||||
|
'whether\n'
|
||||||
|
'"__getitem__()" or "__class_getitem__()" should be called:\n'
|
||||||
|
'\n'
|
||||||
|
' from inspect import isclass\n'
|
||||||
|
'\n'
|
||||||
|
' def subscribe(obj, x):\n'
|
||||||
|
' """Return the result of the expression `obj[x]`"""\n'
|
||||||
|
'\n'
|
||||||
|
' class_of_obj = type(obj)\n'
|
||||||
|
'\n'
|
||||||
|
' # If the class of obj defines __getitem__,\n'
|
||||||
|
' # call class_of_obj.__getitem__(obj, x)\n'
|
||||||
|
" if hasattr(class_of_obj, '__getitem__'):\n"
|
||||||
|
' return class_of_obj.__getitem__(obj, x)\n'
|
||||||
|
'\n'
|
||||||
|
' # Else, if obj is a class and defines '
|
||||||
|
'__class_getitem__,\n'
|
||||||
|
' # call obj.__class_getitem__(x)\n'
|
||||||
|
' elif isclass(obj) and hasattr(obj, '
|
||||||
|
"'__class_getitem__'):\n"
|
||||||
|
' return obj.__class_getitem__(x)\n'
|
||||||
|
'\n'
|
||||||
|
' # Else, raise an exception\n'
|
||||||
|
' else:\n'
|
||||||
|
' raise TypeError(\n'
|
||||||
|
' f"\'{class_of_obj.__name__}\' object is not '
|
||||||
|
'subscriptable"\n'
|
||||||
|
' )\n'
|
||||||
|
'\n'
|
||||||
|
'In Python, all classes are themselves instances of other '
|
||||||
|
'classes. The\n'
|
||||||
|
'class of a class is known as that class’s *metaclass*, and '
|
||||||
|
'most\n'
|
||||||
|
'classes have the "type" class as their metaclass. "type" '
|
||||||
|
'does not\n'
|
||||||
|
'define "__getitem__()", meaning that expressions such as '
|
||||||
|
'"list[int]",\n'
|
||||||
|
'"dict[str, float]" and "tuple[str, bytes]" all result in\n'
|
||||||
|
'"__class_getitem__()" being called:\n'
|
||||||
|
'\n'
|
||||||
|
' >>> # list has class "type" as its metaclass, like most '
|
||||||
|
'classes:\n'
|
||||||
|
' >>> type(list)\n'
|
||||||
|
" <class 'type'>\n"
|
||||||
|
' >>> type(dict) == type(list) == type(tuple) == type(str) '
|
||||||
|
'== type(bytes)\n'
|
||||||
|
' True\n'
|
||||||
|
' >>> # "list[int]" calls "list.__class_getitem__(int)"\n'
|
||||||
|
' >>> list[int]\n'
|
||||||
|
' list[int]\n'
|
||||||
|
' >>> # list.__class_getitem__ returns a GenericAlias '
|
||||||
|
'object:\n'
|
||||||
|
' >>> type(list[int])\n'
|
||||||
|
" <class 'types.GenericAlias'>\n"
|
||||||
|
'\n'
|
||||||
|
'However, if a class has a custom metaclass that defines\n'
|
||||||
|
'"__getitem__()", subscribing the class may result in '
|
||||||
|
'different\n'
|
||||||
|
'behaviour. An example of this can be found in the "enum" '
|
||||||
|
'module:\n'
|
||||||
|
'\n'
|
||||||
|
' >>> from enum import Enum\n'
|
||||||
|
' >>> class Menu(Enum):\n'
|
||||||
|
' ... """A breakfast menu"""\n'
|
||||||
|
" ... SPAM = 'spam'\n"
|
||||||
|
" ... BACON = 'bacon'\n"
|
||||||
|
' ...\n'
|
||||||
|
' >>> # Enum classes have a custom metaclass:\n'
|
||||||
|
' >>> type(Menu)\n'
|
||||||
|
" <class 'enum.EnumMeta'>\n"
|
||||||
|
' >>> # EnumMeta defines __getitem__,\n'
|
||||||
|
' >>> # so __class_getitem__ is not called,\n'
|
||||||
|
' >>> # and the result is not a GenericAlias object:\n'
|
||||||
|
" >>> Menu['SPAM']\n"
|
||||||
|
" <Menu.SPAM: 'spam'>\n"
|
||||||
|
" >>> type(Menu['SPAM'])\n"
|
||||||
|
" <enum 'Menu'>\n"
|
||||||
'\n'
|
'\n'
|
||||||
'See also:\n'
|
'See also:\n'
|
||||||
'\n'
|
'\n'
|
||||||
' **PEP 560** - Core support for typing module and generic '
|
' **PEP 560** - Core Support for typing module and generic '
|
||||||
'types\n'
|
'types\n'
|
||||||
|
' Introducing "__class_getitem__()", and outlining when '
|
||||||
|
'a\n'
|
||||||
|
' subscription results in "__class_getitem__()" being '
|
||||||
|
'called\n'
|
||||||
|
' instead of "__getitem__()"\n'
|
||||||
'\n'
|
'\n'
|
||||||
'\n'
|
'\n'
|
||||||
'Emulating callable objects\n'
|
'Emulating callable objects\n'
|
||||||
|
|
@ -9453,60 +9627,60 @@
|
||||||
'\n'
|
'\n'
|
||||||
'The following methods can be defined to implement container '
|
'The following methods can be defined to implement container '
|
||||||
'objects.\n'
|
'objects.\n'
|
||||||
'Containers usually are sequences (such as lists or tuples) '
|
'Containers usually are *sequences* (such as "lists" or '
|
||||||
'or mappings\n'
|
'"tuples") or\n'
|
||||||
'(like dictionaries), but can represent other containers as '
|
'*mappings* (like "dictionaries"), but can represent other '
|
||||||
'well. The\n'
|
'containers\n'
|
||||||
'first set of methods is used either to emulate a sequence or '
|
'as well. The first set of methods is used either to emulate '
|
||||||
'to\n'
|
'a\n'
|
||||||
'emulate a mapping; the difference is that for a sequence, '
|
'sequence or to emulate a mapping; the difference is that for '
|
||||||
'the\n'
|
'a\n'
|
||||||
'allowable keys should be the integers *k* for which "0 <= k '
|
'sequence, the allowable keys should be the integers *k* for '
|
||||||
'< N" where\n'
|
'which "0\n'
|
||||||
'*N* is the length of the sequence, or slice objects, which '
|
'<= k < N" where *N* is the length of the sequence, or '
|
||||||
'define a\n'
|
'"slice" objects,\n'
|
||||||
'range of items. It is also recommended that mappings '
|
'which define a range of items. It is also recommended that '
|
||||||
'provide the\n'
|
'mappings\n'
|
||||||
'methods "keys()", "values()", "items()", "get()", '
|
'provide the methods "keys()", "values()", "items()", '
|
||||||
'"clear()",\n'
|
'"get()",\n'
|
||||||
'"setdefault()", "pop()", "popitem()", "copy()", and '
|
'"clear()", "setdefault()", "pop()", "popitem()", "copy()", '
|
||||||
'"update()"\n'
|
'and\n'
|
||||||
'behaving similar to those for Python’s standard dictionary '
|
'"update()" behaving similar to those for Python’s standard\n'
|
||||||
|
'"dictionary" objects. The "collections.abc" module provides '
|
||||||
|
'a\n'
|
||||||
|
'"MutableMapping" *abstract base class* to help create those '
|
||||||
|
'methods\n'
|
||||||
|
'from a base set of "__getitem__()", "__setitem__()", '
|
||||||
|
'"__delitem__()",\n'
|
||||||
|
'and "keys()". Mutable sequences should provide methods '
|
||||||
|
'"append()",\n'
|
||||||
|
'"count()", "index()", "extend()", "insert()", "pop()", '
|
||||||
|
'"remove()",\n'
|
||||||
|
'"reverse()" and "sort()", like Python standard "list" '
|
||||||
'objects.\n'
|
'objects.\n'
|
||||||
'The "collections.abc" module provides a "MutableMapping" '
|
'Finally, sequence types should implement addition (meaning\n'
|
||||||
'abstract base\n'
|
'concatenation) and multiplication (meaning repetition) by '
|
||||||
'class to help create those methods from a base set of '
|
'defining the\n'
|
||||||
'"__getitem__()",\n'
|
'methods "__add__()", "__radd__()", "__iadd__()", '
|
||||||
'"__setitem__()", "__delitem__()", and "keys()". Mutable '
|
'"__mul__()",\n'
|
||||||
'sequences\n'
|
'"__rmul__()" and "__imul__()" described below; they should '
|
||||||
'should provide methods "append()", "count()", "index()", '
|
'not define\n'
|
||||||
'"extend()",\n'
|
'other numerical operators. It is recommended that both '
|
||||||
'"insert()", "pop()", "remove()", "reverse()" and "sort()", '
|
'mappings and\n'
|
||||||
'like Python\n'
|
'sequences implement the "__contains__()" method to allow '
|
||||||
'standard list objects. Finally, sequence types should '
|
'efficient use\n'
|
||||||
'implement\n'
|
'of the "in" operator; for mappings, "in" should search the '
|
||||||
'addition (meaning concatenation) and multiplication '
|
'mapping’s\n'
|
||||||
'(meaning\n'
|
'keys; for sequences, it should search through the values. '
|
||||||
'repetition) by defining the methods "__add__()", '
|
'It is\n'
|
||||||
'"__radd__()",\n'
|
'further recommended that both mappings and sequences '
|
||||||
'"__iadd__()", "__mul__()", "__rmul__()" and "__imul__()" '
|
'implement the\n'
|
||||||
'described\n'
|
'"__iter__()" method to allow efficient iteration through '
|
||||||
'below; they should not define other numerical operators. It '
|
'the\n'
|
||||||
'is\n'
|
'container; for mappings, "__iter__()" should iterate through '
|
||||||
'recommended that both mappings and sequences implement the\n'
|
'the\n'
|
||||||
'"__contains__()" method to allow efficient use of the "in" '
|
'object’s keys; for sequences, it should iterate through the '
|
||||||
'operator;\n'
|
'values.\n'
|
||||||
'for mappings, "in" should search the mapping’s keys; for '
|
|
||||||
'sequences, it\n'
|
|
||||||
'should search through the values. It is further recommended '
|
|
||||||
'that both\n'
|
|
||||||
'mappings and sequences implement the "__iter__()" method to '
|
|
||||||
'allow\n'
|
|
||||||
'efficient iteration through the container; for mappings, '
|
|
||||||
'"__iter__()"\n'
|
|
||||||
'should iterate through the object’s keys; for sequences, it '
|
|
||||||
'should\n'
|
|
||||||
'iterate through the values.\n'
|
|
||||||
'\n'
|
'\n'
|
||||||
'object.__len__(self)\n'
|
'object.__len__(self)\n'
|
||||||
'\n'
|
'\n'
|
||||||
|
|
@ -9564,22 +9738,23 @@
|
||||||
'object.__getitem__(self, key)\n'
|
'object.__getitem__(self, key)\n'
|
||||||
'\n'
|
'\n'
|
||||||
' Called to implement evaluation of "self[key]". For '
|
' Called to implement evaluation of "self[key]". For '
|
||||||
'sequence types,\n'
|
'*sequence*\n'
|
||||||
' the accepted keys should be integers and slice objects. '
|
' types, the accepted keys should be integers and slice '
|
||||||
'Note that\n'
|
'objects.\n'
|
||||||
' the special interpretation of negative indexes (if the '
|
' Note that the special interpretation of negative indexes '
|
||||||
'class wishes\n'
|
'(if the\n'
|
||||||
' to emulate a sequence type) is up to the "__getitem__()" '
|
' class wishes to emulate a *sequence* type) is up to the\n'
|
||||||
'method. If\n'
|
' "__getitem__()" method. If *key* is of an inappropriate '
|
||||||
' *key* is of an inappropriate type, "TypeError" may be '
|
'type,\n'
|
||||||
'raised; if of\n'
|
' "TypeError" may be raised; if of a value outside the set '
|
||||||
' a value outside the set of indexes for the sequence '
|
'of indexes\n'
|
||||||
'(after any\n'
|
' for the sequence (after any special interpretation of '
|
||||||
' special interpretation of negative values), "IndexError" '
|
'negative\n'
|
||||||
|
' values), "IndexError" should be raised. For *mapping* '
|
||||||
|
'types, if\n'
|
||||||
|
' *key* is missing (not in the container), "KeyError" '
|
||||||
'should be\n'
|
'should be\n'
|
||||||
' raised. For mapping types, if *key* is missing (not in '
|
' raised.\n'
|
||||||
'the\n'
|
|
||||||
' container), "KeyError" should be raised.\n'
|
|
||||||
'\n'
|
'\n'
|
||||||
' Note:\n'
|
' Note:\n'
|
||||||
'\n'
|
'\n'
|
||||||
|
|
@ -9589,6 +9764,14 @@
|
||||||
'the\n'
|
'the\n'
|
||||||
' sequence.\n'
|
' sequence.\n'
|
||||||
'\n'
|
'\n'
|
||||||
|
' Note:\n'
|
||||||
|
'\n'
|
||||||
|
' When subscripting a *class*, the special class method\n'
|
||||||
|
' "__class_getitem__()" may be called instead of '
|
||||||
|
'"__getitem__()".\n'
|
||||||
|
' See __class_getitem__ versus __getitem__ for more '
|
||||||
|
'details.\n'
|
||||||
|
'\n'
|
||||||
'object.__setitem__(self, key, value)\n'
|
'object.__setitem__(self, key, value)\n'
|
||||||
'\n'
|
'\n'
|
||||||
' Called to implement assignment to "self[key]". Same note '
|
' Called to implement assignment to "self[key]". Same note '
|
||||||
|
|
@ -10376,9 +10559,9 @@
|
||||||
' >>> from keyword import iskeyword\n'
|
' >>> from keyword import iskeyword\n'
|
||||||
'\n'
|
'\n'
|
||||||
" >>> 'hello'.isidentifier(), iskeyword('hello')\n"
|
" >>> 'hello'.isidentifier(), iskeyword('hello')\n"
|
||||||
' True, False\n'
|
' (True, False)\n'
|
||||||
" >>> 'def'.isidentifier(), iskeyword('def')\n"
|
" >>> 'def'.isidentifier(), iskeyword('def')\n"
|
||||||
' True, True\n'
|
' (True, True)\n'
|
||||||
'\n'
|
'\n'
|
||||||
'str.islower()\n'
|
'str.islower()\n'
|
||||||
'\n'
|
'\n'
|
||||||
|
|
@ -10729,7 +10912,7 @@
|
||||||
" >>> ' 1 2 3 '.split()\n"
|
" >>> ' 1 2 3 '.split()\n"
|
||||||
" ['1', '2', '3']\n"
|
" ['1', '2', '3']\n"
|
||||||
'\n'
|
'\n'
|
||||||
'str.splitlines([keepends])\n'
|
'str.splitlines(keepends=False)\n'
|
||||||
'\n'
|
'\n'
|
||||||
' Return a list of the lines in the string, breaking at '
|
' Return a list of the lines in the string, breaking at '
|
||||||
'line\n'
|
'line\n'
|
||||||
|
|
@ -12060,14 +12243,14 @@
|
||||||
'for"\n'
|
'for"\n'
|
||||||
' statement to execute the body of the function.\n'
|
' statement to execute the body of the function.\n'
|
||||||
'\n'
|
'\n'
|
||||||
' Calling the asynchronous iterator’s "aiterator.__anext__()"\n'
|
' Calling the asynchronous iterator’s "aiterator.__anext__" '
|
||||||
' method will return an *awaitable* which when awaited will\n'
|
'method\n'
|
||||||
' execute until it provides a value using the "yield" '
|
' will return an *awaitable* which when awaited will execute '
|
||||||
'expression.\n'
|
'until\n'
|
||||||
' When the function executes an empty "return" statement or '
|
' it provides a value using the "yield" expression. When the\n'
|
||||||
'falls\n'
|
' function executes an empty "return" statement or falls off '
|
||||||
' off the end, a "StopAsyncIteration" exception is raised and '
|
|
||||||
'the\n'
|
'the\n'
|
||||||
|
' end, a "StopAsyncIteration" exception is raised and the\n'
|
||||||
' asynchronous iterator will have reached the end of the set '
|
' asynchronous iterator will have reached the end of the set '
|
||||||
'of\n'
|
'of\n'
|
||||||
' values to be yielded.\n'
|
' values to be yielded.\n'
|
||||||
|
|
@ -12587,9 +12770,9 @@
|
||||||
'"dict"\n'
|
'"dict"\n'
|
||||||
'constructor.\n'
|
'constructor.\n'
|
||||||
'\n'
|
'\n'
|
||||||
'class dict(**kwarg)\n'
|
'class dict(**kwargs)\n'
|
||||||
'class dict(mapping, **kwarg)\n'
|
'class dict(mapping, **kwargs)\n'
|
||||||
'class dict(iterable, **kwarg)\n'
|
'class dict(iterable, **kwargs)\n'
|
||||||
'\n'
|
'\n'
|
||||||
' Return a new dictionary initialized from an optional '
|
' Return a new dictionary initialized from an optional '
|
||||||
'positional\n'
|
'positional\n'
|
||||||
|
|
@ -13694,7 +13877,8 @@
|
||||||
'\n'
|
'\n'
|
||||||
' The arguments to the range constructor must be integers '
|
' The arguments to the range constructor must be integers '
|
||||||
'(either\n'
|
'(either\n'
|
||||||
' built-in "int" or any object that implements the "__index__"\n'
|
' built-in "int" or any object that implements the '
|
||||||
|
'"__index__()"\n'
|
||||||
' special method). If the *step* argument is omitted, it '
|
' special method). If the *step* argument is omitted, it '
|
||||||
'defaults to\n'
|
'defaults to\n'
|
||||||
' "1". If the *start* argument is omitted, it defaults to "0". '
|
' "1". If the *start* argument is omitted, it defaults to "0". '
|
||||||
|
|
|
||||||
557
Misc/NEWS.d/3.9.10.rst
Normal file
557
Misc/NEWS.d/3.9.10.rst
Normal file
|
|
@ -0,0 +1,557 @@
|
||||||
|
.. bpo: 46070
|
||||||
|
.. date: 2022-01-13-17-58-56
|
||||||
|
.. nonce: q8IGth
|
||||||
|
.. release date: 2022-01-13
|
||||||
|
.. section: Core and Builtins
|
||||||
|
|
||||||
|
:c:func:`Py_EndInterpreter` now explicitly untracks all objects currently
|
||||||
|
tracked by the GC. Previously, if an object was used later by another
|
||||||
|
interpreter, calling :c:func:`PyObject_GC_UnTrack` on the object crashed if
|
||||||
|
the previous or the next object of the :c:type:`PyGC_Head` structure became
|
||||||
|
a dangling pointer. Patch by Victor Stinner.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 46085
|
||||||
|
.. date: 2021-12-30-00-23-41
|
||||||
|
.. nonce: bDuJqu
|
||||||
|
.. section: Core and Builtins
|
||||||
|
|
||||||
|
Fix iterator cache mechanism of :class:`OrderedDict`.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 46110
|
||||||
|
.. date: 2021-12-18-02-37-07
|
||||||
|
.. nonce: B6hAfu
|
||||||
|
.. section: Core and Builtins
|
||||||
|
|
||||||
|
Add a maximum recursion check to the PEG parser to avoid stack overflow.
|
||||||
|
Patch by Pablo Galindo
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 46000
|
||||||
|
.. date: 2021-12-07-11-42-44
|
||||||
|
.. nonce: v_ru3k
|
||||||
|
.. section: Core and Builtins
|
||||||
|
|
||||||
|
Improve compatibility of the :mod:`curses` module with NetBSD curses.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 45614
|
||||||
|
.. date: 2021-11-23-12-06-41
|
||||||
|
.. nonce: fIekgI
|
||||||
|
.. section: Core and Builtins
|
||||||
|
|
||||||
|
Fix :mod:`traceback` display for exceptions with invalid module name.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 45806
|
||||||
|
.. date: 2021-11-19-19-21-48
|
||||||
|
.. nonce: DflDMe
|
||||||
|
.. section: Core and Builtins
|
||||||
|
|
||||||
|
Re-introduced fix that allows recovery from stack overflow without crashing
|
||||||
|
the interpreter. The original fix as part of :issue:`42500` was reverted
|
||||||
|
(see release notes for Python 3.9.4) since it introduced an ABI change in a
|
||||||
|
bugfix release which is not allowed. The new fix doesn't introduce any ABI
|
||||||
|
changes. Patch by Mark Shannon.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 45822
|
||||||
|
.. date: 2021-11-16-19-41-04
|
||||||
|
.. nonce: OT6ueS
|
||||||
|
.. section: Core and Builtins
|
||||||
|
|
||||||
|
Fixed a bug in the parser that was causing it to not respect :pep:`263`
|
||||||
|
coding cookies when no flags are provided. Patch by Pablo Galindo
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 45820
|
||||||
|
.. date: 2021-11-16-19-00-27
|
||||||
|
.. nonce: 2X6Psr
|
||||||
|
.. section: Core and Builtins
|
||||||
|
|
||||||
|
Fix a segfault when the parser fails without reading any input. Patch by
|
||||||
|
Pablo Galindo
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 42540
|
||||||
|
.. date: 2021-11-15-12-08-27
|
||||||
|
.. nonce: V2w107
|
||||||
|
.. section: Core and Builtins
|
||||||
|
|
||||||
|
Fix crash when :func:`os.fork` is called with an active non-default memory
|
||||||
|
allocator.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 40479
|
||||||
|
.. date: 2022-01-07-15-20-19
|
||||||
|
.. nonce: EKfr3F
|
||||||
|
.. section: Library
|
||||||
|
|
||||||
|
Fix :mod:`hashlib` *usedforsecurity* option to work correctly with OpenSSL
|
||||||
|
3.0.0 in FIPS mode.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 46070
|
||||||
|
.. date: 2022-01-07-13-51-22
|
||||||
|
.. nonce: -axLUW
|
||||||
|
.. section: Library
|
||||||
|
|
||||||
|
Fix possible segfault when importing the :mod:`asyncio` module from
|
||||||
|
different sub-interpreters in parallel. Patch by Erlend E. Aasland.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 46278
|
||||||
|
.. date: 2022-01-06-13-38-00
|
||||||
|
.. nonce: wILA80
|
||||||
|
.. section: Library
|
||||||
|
|
||||||
|
Reflect ``context`` argument in ``AbstractEventLoop.call_*()`` methods. Loop
|
||||||
|
implementations already support it.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 46239
|
||||||
|
.. date: 2022-01-03-12-59-20
|
||||||
|
.. nonce: ySVSEy
|
||||||
|
.. section: Library
|
||||||
|
|
||||||
|
Improve error message when importing :mod:`asyncio.windows_events` on
|
||||||
|
non-Windows.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 20369
|
||||||
|
.. date: 2021-12-17-12-06-40
|
||||||
|
.. nonce: zzLuBz
|
||||||
|
.. section: Library
|
||||||
|
|
||||||
|
:func:`concurrent.futures.wait` no longer blocks forever when given
|
||||||
|
duplicate Futures. Patch by Kumar Aditya.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 46105
|
||||||
|
.. date: 2021-12-16-14-30-36
|
||||||
|
.. nonce: pprB1K
|
||||||
|
.. section: Library
|
||||||
|
|
||||||
|
Honor spec when generating requirement specs with urls and extras
|
||||||
|
(importlib_metadata 4.8.3).
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 26952
|
||||||
|
.. date: 2021-12-14-13-18-45
|
||||||
|
.. nonce: hjhISq
|
||||||
|
.. section: Library
|
||||||
|
|
||||||
|
:mod:`argparse` raises :exc:`ValueError` with clear message when trying to
|
||||||
|
render usage for an empty mutually-exclusive group. Previously it raised a
|
||||||
|
cryptic :exc:`IndexError`.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 27718
|
||||||
|
.. date: 2021-12-11-22-51-30
|
||||||
|
.. nonce: MgQiGl
|
||||||
|
.. section: Library
|
||||||
|
|
||||||
|
Fix help for the :mod:`signal` module. Some functions (e.g. ``signal()`` and
|
||||||
|
``getsignal()``) were omitted.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 46032
|
||||||
|
.. date: 2021-12-11-15-45-07
|
||||||
|
.. nonce: HmciLT
|
||||||
|
.. section: Library
|
||||||
|
|
||||||
|
The ``registry()`` method of :func:`functools.singledispatch` functions
|
||||||
|
checks now the first argument or the first parameter annotation and raises a
|
||||||
|
TypeError if it is not supported. Previously unsupported "types" were
|
||||||
|
ignored (e.g. ``typing.List[int]``) or caused an error at calling time (e.g.
|
||||||
|
``list[int]``).
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 46018
|
||||||
|
.. date: 2021-12-09-00-44-42
|
||||||
|
.. nonce: hkTI7v
|
||||||
|
.. section: Library
|
||||||
|
|
||||||
|
Ensure that :func:`math.expm1` does not raise on underflow.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 27946
|
||||||
|
.. date: 2021-12-04-20-08-42
|
||||||
|
.. nonce: -Vuarf
|
||||||
|
.. section: Library
|
||||||
|
|
||||||
|
Fix possible crash when getting an attribute of
|
||||||
|
class:`xml.etree.ElementTree.Element` simultaneously with replacing the
|
||||||
|
``attrib`` dict.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 13236
|
||||||
|
.. date: 2021-11-30-13-52-02
|
||||||
|
.. nonce: FmJIkO
|
||||||
|
.. section: Library
|
||||||
|
|
||||||
|
:class:`unittest.TextTestResult` and :class:`unittest.TextTestRunner` flush
|
||||||
|
now the output stream more often.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 37658
|
||||||
|
.. date: 2021-11-28-15-30-34
|
||||||
|
.. nonce: 8Hno7d
|
||||||
|
.. section: Library
|
||||||
|
|
||||||
|
Fix issue when on certain conditions ``asyncio.wait_for()`` may allow a
|
||||||
|
coroutine to complete successfully, but fail to return the result,
|
||||||
|
potentially causing memory leaks or other issues.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 45831
|
||||||
|
.. date: 2021-11-17-19-25-37
|
||||||
|
.. nonce: 9-TojK
|
||||||
|
.. section: Library
|
||||||
|
|
||||||
|
:mod:`faulthandler` can now write ASCII-only strings (like filenames and
|
||||||
|
function names) with a single write() syscall when dumping a traceback. It
|
||||||
|
reduces the risk of getting an unreadable dump when two threads or two
|
||||||
|
processes dump a traceback to the same file (like stderr) at the same time.
|
||||||
|
Patch by Victor Stinner.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 41735
|
||||||
|
.. date: 2021-11-17-11-38-30
|
||||||
|
.. nonce: 2feh9v
|
||||||
|
.. section: Library
|
||||||
|
|
||||||
|
Fix thread lock in ``zlib.Decompress.flush()`` method before
|
||||||
|
``PyObject_GetBuffer``.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 45664
|
||||||
|
.. date: 2021-10-28-23-40-54
|
||||||
|
.. nonce: 7dqtxQ
|
||||||
|
.. section: Library
|
||||||
|
|
||||||
|
Fix :func:`types.resolve_bases` and :func:`types.new_class` for
|
||||||
|
:class:`types.GenericAlias` instance as a base.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 45663
|
||||||
|
.. date: 2021-10-28-23-11-59
|
||||||
|
.. nonce: J90N5R
|
||||||
|
.. section: Library
|
||||||
|
|
||||||
|
Fix :func:`dataclasses.is_dataclass` for dataclasses which are subclasses of
|
||||||
|
:class:`types.GenericAlias`.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 45662
|
||||||
|
.. date: 2021-10-28-22-58-14
|
||||||
|
.. nonce: sJd7Ir
|
||||||
|
.. section: Library
|
||||||
|
|
||||||
|
Fix the repr of :data:`dataclasses.InitVar` with a type alias to the
|
||||||
|
built-in class, e.g. ``InitVar[list[int]]``.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 43498
|
||||||
|
.. date: 2021-04-20-14-14-16
|
||||||
|
.. nonce: L_Hq-8
|
||||||
|
.. section: Library
|
||||||
|
|
||||||
|
Avoid a possible *"RuntimeError: dictionary changed size during iteration"*
|
||||||
|
when adjusting the process count of :class:`ProcessPoolExecutor`.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 29620
|
||||||
|
.. date: 2018-08-21-16-20-33
|
||||||
|
.. nonce: xxx666
|
||||||
|
.. section: Library
|
||||||
|
|
||||||
|
:func:`~unittest.TestCase.assertWarns` no longer raises a
|
||||||
|
``RuntimeException`` when accessing a module's ``__warningregistry__``
|
||||||
|
causes importation of a new module, or when a new module is imported in
|
||||||
|
another thread. Patch by Kernc.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 19737
|
||||||
|
.. date: 2021-11-28-22-43-21
|
||||||
|
.. nonce: cOOubB
|
||||||
|
.. section: Documentation
|
||||||
|
|
||||||
|
Update the documentation for the :func:`globals` function.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 45840
|
||||||
|
.. date: 2021-11-19-02-02-32
|
||||||
|
.. nonce: A51B2S
|
||||||
|
.. section: Documentation
|
||||||
|
|
||||||
|
Improve cross-references in the documentation for the data model.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 45788
|
||||||
|
.. date: 2021-11-18-00-07-40
|
||||||
|
.. nonce: qibUoB
|
||||||
|
.. section: Documentation
|
||||||
|
|
||||||
|
Link doc for sys.prefix to sysconfig doc on installation paths.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 25381
|
||||||
|
.. date: 2021-06-21-17-51-51
|
||||||
|
.. nonce: 7Kn-_H
|
||||||
|
.. section: Documentation
|
||||||
|
|
||||||
|
In the extending chapter of the extending doc, update a paragraph about the
|
||||||
|
global variables containing exception information.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 43905
|
||||||
|
.. date: 2021-05-24-05-00-12
|
||||||
|
.. nonce: tBIndE
|
||||||
|
.. section: Documentation
|
||||||
|
|
||||||
|
Expanded :func:`~dataclasses.astuple` and :func:`~dataclasses.asdict` docs,
|
||||||
|
warning about deepcopy being applied and providing a workaround.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 41028
|
||||||
|
.. date: 2020-06-18-23-37-03
|
||||||
|
.. nonce: vM8bC8
|
||||||
|
.. section: Documentation
|
||||||
|
|
||||||
|
Language and version switchers, previously maintained in every cpython
|
||||||
|
branches, are now handled by docsbuild-script.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 46205
|
||||||
|
.. date: 2022-01-07-14-06-12
|
||||||
|
.. nonce: dnc2OC
|
||||||
|
.. section: Tests
|
||||||
|
|
||||||
|
Fix hang in runtest_mp due to race condition
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 46263
|
||||||
|
.. date: 2022-01-06-15-45-34
|
||||||
|
.. nonce: bJXek6
|
||||||
|
.. section: Tests
|
||||||
|
|
||||||
|
Fix test_capi on FreeBSD 14-dev: instruct jemalloc to not fill freed memory
|
||||||
|
with junk byte.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 46150
|
||||||
|
.. date: 2021-12-23-13-42-15
|
||||||
|
.. nonce: RhtADs
|
||||||
|
.. section: Tests
|
||||||
|
|
||||||
|
Now ``fakename`` in ``test_pathlib.PosixPathTest.test_expanduser`` is
|
||||||
|
checked to be non-existent.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 46129
|
||||||
|
.. date: 2021-12-19-12-20-57
|
||||||
|
.. nonce: I3MunH
|
||||||
|
.. section: Tests
|
||||||
|
|
||||||
|
Rewrite ``asyncio.locks`` tests with
|
||||||
|
:class:`unittest.IsolatedAsyncioTestCase` usage.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 23819
|
||||||
|
.. date: 2021-12-19-08-44-32
|
||||||
|
.. nonce: 9ueiII
|
||||||
|
.. section: Tests
|
||||||
|
|
||||||
|
Fixed :mod:`asyncio` tests in python optimized mode. Patch by Kumar Aditya.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 46114
|
||||||
|
.. date: 2021-12-17-14-46-19
|
||||||
|
.. nonce: 9iyZ_9
|
||||||
|
.. section: Tests
|
||||||
|
|
||||||
|
Fix test case for OpenSSL 3.0.1 version. OpenSSL 3.0 uses ``0xMNN00PP0L``.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 19460
|
||||||
|
.. date: 2021-11-28-15-25-02
|
||||||
|
.. nonce: lr0aWs
|
||||||
|
.. section: Tests
|
||||||
|
|
||||||
|
Add new Test for :class:`email.mime.nonmultipart.MIMENonMultipart`.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 45835
|
||||||
|
.. date: 2021-11-17-14-28-08
|
||||||
|
.. nonce: Mgyhjx
|
||||||
|
.. section: Tests
|
||||||
|
|
||||||
|
Fix race condition in test_queue tests with multiple "feeder" threads.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 46263
|
||||||
|
.. date: 2022-01-05-02-58-10
|
||||||
|
.. nonce: xiv8NU
|
||||||
|
.. section: Build
|
||||||
|
|
||||||
|
``configure`` no longer sets ``MULTIARCH`` on FreeBSD platforms.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 46106
|
||||||
|
.. date: 2021-12-20-07-10-41
|
||||||
|
.. nonce: 5qcv3L
|
||||||
|
.. section: Build
|
||||||
|
|
||||||
|
Updated OpenSSL to 1.1.1m in Windows builds, macOS installer builds, and CI.
|
||||||
|
Patch by Kumar Aditya.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 44035
|
||||||
|
.. date: 2021-12-06-09-31-27
|
||||||
|
.. nonce: BiO4XC
|
||||||
|
.. section: Build
|
||||||
|
|
||||||
|
CI now verifies that autoconf files have been regenerated with a current and
|
||||||
|
unpatched autoconf package.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 33393
|
||||||
|
.. date: 2021-11-25-20-26-06
|
||||||
|
.. nonce: 24YNtM
|
||||||
|
.. section: Build
|
||||||
|
|
||||||
|
Update ``config.guess`` to 2021-06-03 and ``config.sub`` to 2021-08-14.
|
||||||
|
``Makefile`` now has an ``update-config`` target to make updating more
|
||||||
|
convenient.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 45866
|
||||||
|
.. date: 2021-11-25-13-53-36
|
||||||
|
.. nonce: ZH1W8N
|
||||||
|
.. section: Build
|
||||||
|
|
||||||
|
``make regen-all`` now produces the same output when run from a directory
|
||||||
|
other than the source tree: when building Python out of the source tree.
|
||||||
|
pegen now strips directory of the "generated by pygen from <FILENAME>"
|
||||||
|
header Patch by Victor Stinner.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 41498
|
||||||
|
.. date: 2021-11-25-09-15-04
|
||||||
|
.. nonce: qAk5eo
|
||||||
|
.. section: Build
|
||||||
|
|
||||||
|
Python now compiles on platforms without ``sigset_t``. Several functions in
|
||||||
|
:mod:`signal` are not available when ``sigset_t`` is missing.
|
||||||
|
|
||||||
|
Based on patch by Roman Yurchak for pyodide.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 45881
|
||||||
|
.. date: 2021-11-24-17-14-06
|
||||||
|
.. nonce: GTXXLk
|
||||||
|
.. section: Build
|
||||||
|
|
||||||
|
``setup.py`` now uses ``CC`` from environment first to discover multiarch
|
||||||
|
and cross compile paths.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 45901
|
||||||
|
.. date: 2021-11-26-18-17-41
|
||||||
|
.. nonce: c5IBqM
|
||||||
|
.. section: Windows
|
||||||
|
|
||||||
|
When installed through the Microsoft Store and set as the default app for
|
||||||
|
:file:`*.py` files, command line arguments will now be passed to Python when
|
||||||
|
invoking a script without explicitly launching Python (that is, ``script.py
|
||||||
|
args`` rather than ``python script.py args``).
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 40477
|
||||||
|
.. date: 2022-01-02-21-56-53
|
||||||
|
.. nonce: W3nnM6
|
||||||
|
.. section: macOS
|
||||||
|
|
||||||
|
The Python Launcher app for macOS now properly launches scripts and, if
|
||||||
|
necessary, the Terminal app when running on recent macOS releases.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 45732
|
||||||
|
.. date: 2021-12-05-23-52-03
|
||||||
|
.. nonce: -BWrnh
|
||||||
|
.. section: macOS
|
||||||
|
|
||||||
|
Update python.org macOS installer to use Tcl/Tk 8.6.12.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 45838
|
||||||
|
.. date: 2021-11-18-11-20-21
|
||||||
|
.. nonce: TH6mwc
|
||||||
|
.. section: Tools/Demos
|
||||||
|
|
||||||
|
Fix line number calculation when debugging Python with GDB.
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
.. bpo: 39026
|
||||||
|
.. date: 2021-11-09-15-42-11
|
||||||
|
.. nonce: sUnYWn
|
||||||
|
.. section: C API
|
||||||
|
|
||||||
|
Fix Python.h to build C extensions with Xcode: remove a relative include
|
||||||
|
from ``Include/cpython/pystate.h``.
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
``setup.py`` now uses ``CC`` from environment first to discover multiarch
|
|
||||||
and cross compile paths.
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
Python now compiles on platforms without ``sigset_t``. Several functions
|
|
||||||
in :mod:`signal` are not available when ``sigset_t`` is missing.
|
|
||||||
|
|
||||||
Based on patch by Roman Yurchak for pyodide.
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
``make regen-all`` now produces the same output when run from a directory
|
|
||||||
other than the source tree: when building Python out of the source tree.
|
|
||||||
pegen now strips directory of the "generated by pygen from <FILENAME>" header
|
|
||||||
Patch by Victor Stinner.
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
Update ``config.guess`` to 2021-06-03 and ``config.sub`` to 2021-08-14.
|
|
||||||
``Makefile`` now has an ``update-config`` target to make updating more
|
|
||||||
convenient.
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
CI now verifies that autoconf files have been regenerated with a current and
|
|
||||||
unpatched autoconf package.
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
Updated OpenSSL to 1.1.1m in Windows builds, macOS installer builds, and CI.
|
|
||||||
Patch by Kumar Aditya.
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
``configure`` no longer sets ``MULTIARCH`` on FreeBSD platforms.
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
Fix Python.h to build C extensions with Xcode: remove a relative include
|
|
||||||
from ``Include/cpython/pystate.h``.
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
Fix crash when :func:`os.fork` is called with an active non-default
|
|
||||||
memory allocator.
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
Fix a segfault when the parser fails without reading any input. Patch by
|
|
||||||
Pablo Galindo
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
Fixed a bug in the parser that was causing it to not respect :pep:`263`
|
|
||||||
coding cookies when no flags are provided. Patch by Pablo Galindo
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
Re-introduced fix that allows recovery from stack overflow without crashing
|
|
||||||
the interpreter. The original fix as part of :issue:`42500` was reverted
|
|
||||||
(see release notes for Python 3.9.4) since it introduced an ABI change in a
|
|
||||||
bugfix release which is not allowed. The new fix doesn't introduce any ABI
|
|
||||||
changes. Patch by Mark Shannon.
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Fix :mod:`traceback` display for exceptions with invalid module name.
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Improve compatibility of the :mod:`curses` module with NetBSD curses.
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
Add a maximum recursion check to the PEG parser to avoid stack overflow.
|
|
||||||
Patch by Pablo Galindo
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Fix iterator cache mechanism of :class:`OrderedDict`.
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
:c:func:`Py_EndInterpreter` now explicitly untracks all objects currently
|
|
||||||
tracked by the GC. Previously, if an object was used later by another
|
|
||||||
interpreter, calling :c:func:`PyObject_GC_UnTrack` on the object crashed if the
|
|
||||||
previous or the next object of the :c:type:`PyGC_Head` structure became a
|
|
||||||
dangling pointer. Patch by Victor Stinner.
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
Language and version switchers, previously maintained in every cpython
|
|
||||||
branches, are now handled by docsbuild-script.
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
Expanded :func:`~dataclasses.astuple` and :func:`~dataclasses.asdict` docs,
|
|
||||||
warning about deepcopy being applied and providing a workaround.
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
In the extending chapter of the extending doc, update a paragraph about the
|
|
||||||
global variables containing exception information.
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Link doc for sys.prefix to sysconfig doc on installation paths.
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Improve cross-references in the documentation for the data model.
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Update the documentation for the :func:`globals` function.
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
:func:`~unittest.TestCase.assertWarns` no longer raises a ``RuntimeException``
|
|
||||||
when accessing a module's ``__warningregistry__`` causes importation of a new
|
|
||||||
module, or when a new module is imported in another thread. Patch by Kernc.
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
Avoid a possible *"RuntimeError: dictionary changed size during iteration"*
|
|
||||||
when adjusting the process count of :class:`ProcessPoolExecutor`.
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
Fix the repr of :data:`dataclasses.InitVar` with a type alias to the
|
|
||||||
built-in class, e.g. ``InitVar[list[int]]``.
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
Fix :func:`dataclasses.is_dataclass` for dataclasses which are subclasses of
|
|
||||||
:class:`types.GenericAlias`.
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
Fix :func:`types.resolve_bases` and :func:`types.new_class` for
|
|
||||||
:class:`types.GenericAlias` instance as a base.
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Fix thread lock in ``zlib.Decompress.flush()`` method before ``PyObject_GetBuffer``.
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
:mod:`faulthandler` can now write ASCII-only strings (like filenames and
|
|
||||||
function names) with a single write() syscall when dumping a traceback. It
|
|
||||||
reduces the risk of getting an unreadable dump when two threads or two
|
|
||||||
processes dump a traceback to the same file (like stderr) at the same time.
|
|
||||||
Patch by Victor Stinner.
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
Fix issue when on certain conditions ``asyncio.wait_for()`` may allow a
|
|
||||||
coroutine to complete successfully, but fail to return the result,
|
|
||||||
potentially causing memory leaks or other issues.
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
:class:`unittest.TextTestResult` and :class:`unittest.TextTestRunner` flush
|
|
||||||
now the output stream more often.
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
Fix possible crash when getting an attribute of
|
|
||||||
class:`xml.etree.ElementTree.Element` simultaneously with
|
|
||||||
replacing the ``attrib`` dict.
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Ensure that :func:`math.expm1` does not raise on underflow.
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
The ``registry()`` method of :func:`functools.singledispatch` functions
|
|
||||||
checks now the first argument or the first parameter annotation and raises a
|
|
||||||
TypeError if it is not supported. Previously unsupported "types" were
|
|
||||||
ignored (e.g. ``typing.List[int]``) or caused an error at calling time (e.g.
|
|
||||||
``list[int]``).
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
Fix help for the :mod:`signal` module. Some functions (e.g. ``signal()`` and
|
|
||||||
``getsignal()``) were omitted.
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
:mod:`argparse` raises :exc:`ValueError` with clear message when trying to render usage for an empty mutually-exclusive group. Previously it raised a cryptic :exc:`IndexError`.
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
Honor spec when generating requirement specs with urls and extras
|
|
||||||
(importlib_metadata 4.8.3).
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
:func:`concurrent.futures.wait` no longer blocks forever when given duplicate Futures. Patch by Kumar Aditya.
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
Improve error message when importing :mod:`asyncio.windows_events` on
|
|
||||||
non-Windows.
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
Reflect ``context`` argument in ``AbstractEventLoop.call_*()`` methods. Loop
|
|
||||||
implementations already support it.
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
Fix possible segfault when importing the :mod:`asyncio` module from
|
|
||||||
different sub-interpreters in parallel. Patch by Erlend E. Aasland.
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
Fix :mod:`hashlib` *usedforsecurity* option to work correctly with OpenSSL
|
|
||||||
3.0.0 in FIPS mode.
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Fix race condition in test_queue tests with multiple "feeder" threads.
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Add new Test for :class:`email.mime.nonmultipart.MIMENonMultipart`.
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Fix test case for OpenSSL 3.0.1 version. OpenSSL 3.0 uses ``0xMNN00PP0L``.
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Fixed :mod:`asyncio` tests in python optimized mode. Patch by Kumar Aditya.
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
Rewrite ``asyncio.locks`` tests with
|
|
||||||
:class:`unittest.IsolatedAsyncioTestCase` usage.
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
Now ``fakename`` in ``test_pathlib.PosixPathTest.test_expanduser`` is checked
|
|
||||||
to be non-existent.
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
Fix test_capi on FreeBSD 14-dev: instruct jemalloc to not fill freed memory
|
|
||||||
with junk byte.
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Fix hang in runtest_mp due to race condition
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Fix line number calculation when debugging Python with GDB.
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
When installed through the Microsoft Store and set as the default app for
|
|
||||||
:file:`*.py` files, command line arguments will now be passed to Python when
|
|
||||||
invoking a script without explicitly launching Python (that is, ``script.py
|
|
||||||
args`` rather than ``python script.py args``).
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Update python.org macOS installer to use Tcl/Tk 8.6.12.
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
The Python Launcher app for macOS now properly launches scripts and, if
|
|
||||||
necessary, the Terminal app when running on recent macOS releases.
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
This is Python version 3.9.9
|
This is Python version 3.9.10
|
||||||
============================
|
=============================
|
||||||
|
|
||||||
.. image:: https://travis-ci.org/python/cpython.svg?branch=3.9
|
.. image:: https://travis-ci.org/python/cpython.svg?branch=3.9
|
||||||
:alt: CPython build status on Travis CI
|
:alt: CPython build status on Travis CI
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue