Merge tag 'v3.10.0' into 3.10
Python 3.10.0
diff --git a/Include/patchlevel.h b/Include/patchlevel.h
index 2884ead..afa621e 100644
--- a/Include/patchlevel.h
+++ b/Include/patchlevel.h
@@ -19,11 +19,11 @@
#define PY_MAJOR_VERSION 3
#define PY_MINOR_VERSION 10
#define PY_MICRO_VERSION 0
-#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_GAMMA
-#define PY_RELEASE_SERIAL 2
+#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL
+#define PY_RELEASE_SERIAL 0
/* Version as a string */
-#define PY_VERSION "3.10.0rc2+"
+#define PY_VERSION "3.10.0"
/*--end constants--*/
/* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2.
diff --git a/Lib/pydoc_data/topics.py b/Lib/pydoc_data/topics.py
index e80f49e..7720694 100644
--- a/Lib/pydoc_data/topics.py
+++ b/Lib/pydoc_data/topics.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# Autogenerated by Sphinx on Tue Sep 7 14:18:15 2021
+# Autogenerated by Sphinx on Mon Oct 4 18:28:12 2021
topics = {'assert': 'The "assert" statement\n'
'**********************\n'
'\n'
@@ -936,32 +936,6 @@
'*instance* of the\n'
' owner class.\n'
'\n'
- 'object.__set_name__(self, owner, name)\n'
- '\n'
- ' Called at the time the owning class *owner* is '
- 'created. The\n'
- ' descriptor has been assigned to *name*.\n'
- '\n'
- ' Note:\n'
- '\n'
- ' "__set_name__()" is only called implicitly as part '
- 'of the "type"\n'
- ' constructor, so it will need to be called '
- 'explicitly with the\n'
- ' appropriate parameters when a descriptor is added '
- 'to a class\n'
- ' after initial creation:\n'
- '\n'
- ' class A:\n'
- ' pass\n'
- ' descr = custom_descriptor()\n'
- ' A.attr = descr\n'
- " descr.__set_name__(A, 'attr')\n"
- '\n'
- ' See Creating the class object for more details.\n'
- '\n'
- ' New in version 3.6.\n'
- '\n'
'The attribute "__objclass__" is interpreted by the '
'"inspect" module as\n'
'specifying the class where this object was defined '
@@ -2847,7 +2821,7 @@
'have\n'
' happened.\n'
'\n'
- ' * If the guard evaluates as truthy or missing, the "block" '
+ ' * If the guard evaluates as true or is missing, the "block" '
'inside\n'
' "case_block" is executed.\n'
'\n'
@@ -2908,12 +2882,12 @@
'\n'
'2. If the pattern succeeded, evaluate the "guard".\n'
'\n'
- ' * If the "guard" condition evaluates to “truthy”, the case '
- 'block is\n'
+ ' * If the "guard" condition evaluates as true, the case block '
+ 'is\n'
' selected.\n'
'\n'
- ' * If the "guard" condition evaluates to “falsy”, the case '
- 'block is\n'
+ ' * If the "guard" condition evaluates as false, the case block '
+ 'is\n'
' not selected.\n'
'\n'
' * If the "guard" raises an exception during evaluation, the\n'
@@ -3417,8 +3391,7 @@
'class\n'
' "name_or_attr" before matching:\n'
'\n'
- ' I. The equivalent of "getattr(cls, "__match_args__", ())" '
- 'is\n'
+ ' I. The equivalent of "getattr(cls, "__match_args__", ())" is\n'
' called.\n'
'\n'
' * If this raises an exception, the exception bubbles up.\n'
@@ -4148,13 +4121,13 @@
'\n'
' If "__new__()" is invoked during object construction and '
'it returns\n'
- ' an instance or subclass of *cls*, then the new '
- 'instance’s\n'
- ' "__init__()" method will be invoked like '
- '"__init__(self[, ...])",\n'
- ' where *self* is the new instance and the remaining '
- 'arguments are\n'
- ' the same as were passed to the object constructor.\n'
+ ' an instance of *cls*, then the new instance’s '
+ '"__init__()" method\n'
+ ' will be invoked like "__init__(self[, ...])", where '
+ '*self* is the\n'
+ ' new instance and the remaining arguments are the same as '
+ 'were\n'
+ ' passed to the object constructor.\n'
'\n'
' If "__new__()" does not return an instance of *cls*, '
'then the new\n'
@@ -9024,13 +8997,13 @@
'\n'
' If "__new__()" is invoked during object construction and '
'it returns\n'
- ' an instance or subclass of *cls*, then the new '
- 'instance’s\n'
- ' "__init__()" method will be invoked like "__init__(self[, '
- '...])",\n'
- ' where *self* is the new instance and the remaining '
- 'arguments are\n'
- ' the same as were passed to the object constructor.\n'
+ ' an instance of *cls*, then the new instance’s '
+ '"__init__()" method\n'
+ ' will be invoked like "__init__(self[, ...])", where '
+ '*self* is the\n'
+ ' new instance and the remaining arguments are the same as '
+ 'were\n'
+ ' passed to the object constructor.\n'
'\n'
' If "__new__()" does not return an instance of *cls*, then '
'the new\n'
@@ -9698,32 +9671,6 @@
'of the\n'
' owner class.\n'
'\n'
- 'object.__set_name__(self, owner, name)\n'
- '\n'
- ' Called at the time the owning class *owner* is created. '
- 'The\n'
- ' descriptor has been assigned to *name*.\n'
- '\n'
- ' Note:\n'
- '\n'
- ' "__set_name__()" is only called implicitly as part of '
- 'the "type"\n'
- ' constructor, so it will need to be called explicitly '
- 'with the\n'
- ' appropriate parameters when a descriptor is added to a '
- 'class\n'
- ' after initial creation:\n'
- '\n'
- ' class A:\n'
- ' pass\n'
- ' descr = custom_descriptor()\n'
- ' A.attr = descr\n'
- " descr.__set_name__(A, 'attr')\n"
- '\n'
- ' See Creating the class object for more details.\n'
- '\n'
- ' New in version 3.6.\n'
- '\n'
'The attribute "__objclass__" is interpreted by the "inspect" '
'module as\n'
'specifying the class where this object was defined (setting '
@@ -10013,6 +9960,38 @@
'\n'
' New in version 3.6.\n'
'\n'
+ 'When a class is created, "type.__new__()" scans the class '
+ 'variables\n'
+ 'and makes callbacks to those with a "__set_name__()" hook.\n'
+ '\n'
+ 'object.__set_name__(self, owner, name)\n'
+ '\n'
+ ' Automatically called at the time the owning class *owner* '
+ 'is\n'
+ ' created. The object has been assigned to *name* in that '
+ 'class:\n'
+ '\n'
+ ' class A:\n'
+ ' x = C() # Automatically calls: x.__set_name__(A, '
+ "'x')\n"
+ '\n'
+ ' If the class variable is assigned after the class is '
+ 'created,\n'
+ ' "__set_name__()" will not be called automatically. If '
+ 'needed,\n'
+ ' "__set_name__()" can be called directly:\n'
+ '\n'
+ ' class A:\n'
+ ' pass\n'
+ '\n'
+ ' c = C()\n'
+ ' A.x = c # The hook is not called\n'
+ " c.__set_name__(A, 'x') # Manually invoke the hook\n"
+ '\n'
+ ' See Creating the class object for more details.\n'
+ '\n'
+ ' New in version 3.6.\n'
+ '\n'
'\n'
'Metaclasses\n'
'-----------\n'
@@ -10208,22 +10187,21 @@
'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 '
+ 'customization 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'
+ '1. The "type.__new__" method collects all of the attributes '
+ 'in the\n'
+ ' class 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;\n'
+ '2. Those "__set_name__" methods are called with the class '
+ 'being\n'
+ ' defined and the assigned name of that particular '
+ 'attribute;\n'
'\n'
- '* finally, the "__init_subclass__()" hook is called on the '
- 'immediate\n'
- ' parent of the new class in its method resolution order.\n'
+ '3. The "__init_subclass__()" hook is called on the immediate '
+ 'parent of\n'
+ ' the new class in its method resolution order.\n'
'\n'
'After the class object is created, it is passed to the '
'class\n'
@@ -13364,11 +13342,8 @@
' variables; "f_globals" is used for global variables;\n'
' "f_builtins" is used for built-in (intrinsic) names; '
'"f_lasti"\n'
- ' gives the precise instruction (it represents a wordcode '
- 'index,\n'
- ' which means that to get an index into the bytecode string of '
- 'the\n'
- ' code object it needs to be multiplied by 2).\n'
+ ' gives the precise instruction (this is an index into the\n'
+ ' bytecode string of the code object).\n'
'\n'
' Accessing "f_code" raises an auditing event '
'"object.__getattr__"\n'
diff --git a/Misc/NEWS.d/3.10.0.rst b/Misc/NEWS.d/3.10.0.rst
new file mode 100644
index 0000000..9911344
--- /dev/null
+++ b/Misc/NEWS.d/3.10.0.rst
@@ -0,0 +1,95 @@
+.. bpo: 45121
+.. date: 2021-09-07-17-10-16
+.. nonce: iG-Hsf
+.. release date: 2021-10-04
+.. section: Core and Builtins
+
+Fix issue where ``Protocol.__init__`` raises ``RecursionError`` when it's
+called directly or via ``super()``. Patch provided by Yurii Karabas.
+
+..
+
+.. bpo: 45234
+.. date: 2021-09-17-11-20-55
+.. nonce: qUcTVt
+.. section: Library
+
+Fixed a regression in :func:`~shutil.copyfile`, :func:`~shutil.copy`,
+:func:`~shutil.copy2` raising :exc:`FileNotFoundError` when source is a
+directory, which should raise :exc:`IsADirectoryError`
+
+..
+
+.. bpo: 45216
+.. date: 2021-09-18-13-45-19
+.. nonce: o56nyt
+.. section: Documentation
+
+Remove extra documentation listing methods in ``difflib``. It was rendering
+twice in pydoc and was outdated in some places.
+
+..
+
+.. bpo: 45024
+.. date: 2021-09-08-17-20-19
+.. nonce: dkNPNi
+.. section: Documentation
+
+:mod:`collections.abc` documentation has been expanded to explicitly cover
+how instance and subclass checks work, with additional doctest examples and
+an exhaustive list of ABCs which test membership purely by presence of the
+right :term:`special method`\s. Patch by Raymond Hettinger.
+
+..
+
+.. bpo: 45128
+.. date: 2021-09-16-17-22-35
+.. nonce: Jz6fl2
+.. section: Tests
+
+Fix ``test_multiprocessing_fork`` failure due to ``test_logging`` and
+``sys.modules`` manipulation.
+
+..
+
+.. bpo: 44860
+.. date: 2021-09-08-13-01-37
+.. nonce: qXd0kx
+.. section: Tests
+
+Update ``test_sysconfig.test_user_similar()`` for the posix_user scheme:
+``platlib`` doesn't use :data:`sys.platlibdir`. Patch by Victor Stinner.
+
+..
+
+.. bpo: 45067
+.. date: 2021-09-09-16-45-26
+.. nonce: mFmY92
+.. section: Build
+
+The ncurses function extended_color_content was introduced in 2017
+
+(https://invisible-island.net/ncurses/NEWS.html#index-t20170401). The
+
+ncurses-devel package in CentOS 7 had a older version ncurses resulted in
+compilation error. For compiling ncurses with extended color support, we
+verify the version of the ncurses library >= 20170401.
+
+..
+
+.. bpo: 45193
+.. date: 2021-09-15-03-20-06
+.. nonce: G61_GV
+.. section: IDLE
+
+Make completion boxes appear on Ubuntu again.
+
+..
+
+.. bpo: 45307
+.. date: 2021-09-28-12-00-55
+.. nonce: 3ETFfX
+.. section: C API
+
+Restore the private C API function :func:`_PyImport_FindExtensionObject`. It
+will be removed in Python 3.11.
diff --git a/README.rst b/README.rst
index ecb0738..74e7629 100644
--- a/README.rst
+++ b/README.rst
@@ -1,5 +1,5 @@
-This is Python version 3.10.0 rc2
-=================================
+This is Python version 3.10.0
+=============================
.. image:: https://travis-ci.com/python/cpython.svg?branch=master
:alt: CPython build status on Travis CI