Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
1fc5bf2f
Commit
1fc5bf2f
authored
Mar 27, 2019
by
Jules Lasne (jlasne)
Committed by
Julien Palard
Mar 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Doc: Fixed missing punctuation in datamodel.rst (GH-12581)
parent
bc284f0c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
Doc/reference/datamodel.rst
Doc/reference/datamodel.rst
+14
-14
No files found.
Doc/reference/datamodel.rst
View file @
1fc5bf2f
...
...
@@ -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)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment