Doc: Fixed missing punctuation in datamodel.rst (GH-12581)
This commit is contained in:
parent
bc284f0c7a
commit
1fc5bf2ff2
|
@ -475,13 +475,13 @@ Callable types
|
|||
| :attr:`__doc__` | The function's documentation | Writable |
|
||||
| | string, or ``None`` if | |
|
||||
| | unavailable; not inherited by | |
|
||||
| | subclasses | |
|
||||
| | subclasses. | |
|
||||
+-------------------------+-------------------------------+-----------+
|
||||
| :attr:`~definition.\ | The function's name | Writable |
|
||||
| :attr:`~definition.\ | The function's name. | Writable |
|
||||
| __name__` | | |
|
||||
+-------------------------+-------------------------------+-----------+
|
||||
| :attr:`~definition.\ | The function's | Writable |
|
||||
| __qualname__` | :term:`qualified name` | |
|
||||
| __qualname__` | :term:`qualified name`. | |
|
||||
| | | |
|
||||
| | .. versionadded:: 3.3 | |
|
||||
+-------------------------+-------------------------------+-----------+
|
||||
|
@ -493,7 +493,7 @@ Callable types
|
|||
| | argument values for those | |
|
||||
| | arguments that have defaults, | |
|
||||
| | or ``None`` if no arguments | |
|
||||
| | have a default value | |
|
||||
| | have a default value. | |
|
||||
+-------------------------+-------------------------------+-----------+
|
||||
| :attr:`__code__` | The code object representing | Writable |
|
||||
| | the compiled function body. | |
|
||||
|
@ -1857,11 +1857,11 @@ passed through to all metaclass operations described below.
|
|||
|
||||
When a class definition is executed, the following steps occur:
|
||||
|
||||
* MRO entries are resolved
|
||||
* the appropriate metaclass is determined
|
||||
* the class namespace is prepared
|
||||
* the class body is executed
|
||||
* the class object is created
|
||||
* MRO entries are resolved;
|
||||
* the appropriate metaclass is determined;
|
||||
* the class namespace is prepared;
|
||||
* the class body is executed;
|
||||
* the class object is created.
|
||||
|
||||
|
||||
Resolving MRO entries
|
||||
|
@ -1885,11 +1885,11 @@ Determining the appropriate metaclass
|
|||
|
||||
The appropriate metaclass for a class definition is determined as follows:
|
||||
|
||||
* if no bases and no explicit metaclass are given, then :func:`type` is used
|
||||
* if no bases and no explicit metaclass are given, then :func:`type` is used;
|
||||
* if an explicit metaclass is given and it is *not* an instance of
|
||||
:func:`type`, then it is used directly as the metaclass
|
||||
:func:`type`, then it is used directly as the metaclass;
|
||||
* if an instance of :func:`type` is given as the explicit metaclass, or
|
||||
bases are defined, then the most derived metaclass is used
|
||||
bases are defined, then the most derived metaclass is used.
|
||||
|
||||
The most derived metaclass is selected from the explicitly specified
|
||||
metaclass (if any) and the metaclasses (i.e. ``type(cls)``) of all specified
|
||||
|
@ -1976,7 +1976,7 @@ invoked after creating the class object:
|
|||
* first, ``type.__new__`` collects all of the descriptors in the class
|
||||
namespace that define a :meth:`~object.__set_name__` method;
|
||||
* second, all of these ``__set_name__`` methods are called with the class
|
||||
being defined and the assigned name of that particular descriptor; and
|
||||
being defined and the assigned name of that particular descriptor;
|
||||
* finally, the :meth:`~object.__init_subclass__` hook is called on the
|
||||
immediate parent of the new class in its method resolution order.
|
||||
|
||||
|
@ -2048,7 +2048,7 @@ Emulating generic types
|
|||
-----------------------
|
||||
|
||||
One can implement the generic class syntax as specified by :pep:`484`
|
||||
(for example ``List[int]``) by defining a special method
|
||||
(for example ``List[int]``) by defining a special method:
|
||||
|
||||
.. classmethod:: object.__class_getitem__(cls, key)
|
||||
|
||||
|
|
Loading…
Reference in New Issue