diff options
author | alclarks <57201106+alclarks@users.noreply.github.com> | 2020-01-25 18:49:58 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2020-01-25 18:49:58 (GMT) |
commit | 7de617455ed788e6730c40cf854c4b72b0432194 (patch) | |
tree | 34a80e801b25237e423a2df03852e9e9af0396b5 /Doc/reference | |
parent | aef7dc89879d099dc704bd8037b8a7686fb72838 (diff) | |
download | cpython-7de617455ed788e6730c40cf854c4b72b0432194.zip cpython-7de617455ed788e6730c40cf854c4b72b0432194.tar.gz cpython-7de617455ed788e6730c40cf854c4b72b0432194.tar.bz2 |
bpo-15243: Document __prepare__ as classmethod (GH-17124)
Diffstat (limited to 'Doc/reference')
-rw-r--r-- | Doc/reference/datamodel.rst | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 1442fbe..9520f82 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1945,7 +1945,8 @@ Preparing the class namespace Once the appropriate metaclass has been identified, then the class namespace is prepared. If the metaclass has a ``__prepare__`` attribute, it is called as ``namespace = metaclass.__prepare__(name, bases, **kwds)`` (where the -additional keyword arguments, if any, come from the class definition). +additional keyword arguments, if any, come from the class definition). The +``__prepare__`` method should be implemented as a :func:`classmethod`. If the metaclass has no ``__prepare__`` attribute, then the class namespace is initialised as an empty ordered mapping. |