mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
Python 3.10.0
This commit is contained in:
parent
bc4c705869
commit
b494f5935c
15 changed files with 169 additions and 597 deletions
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue