[Python-checkins] bpo-15243: Document __prepare__ as classmethod (GH-17124)
Berker Peksag
webhook-mailer at python.org
Sat Jan 25 14:05:00 EST 2020
https://github.com/python/cpython/commit/548685e364af3d366d3aef924b2077ee6f8d13dc
commit: 548685e364af3d366d3aef924b2077ee6f8d13dc
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Berker Peksag <berker.peksag at gmail.com>
date: 2020-01-25T22:04:55+03:00
summary:
bpo-15243: Document __prepare__ as classmethod (GH-17124)
(cherry picked from commit 7de617455ed788e6730c40cf854c4b72b0432194)
Co-authored-by: alclarks <57201106+alclarks at users.noreply.github.com>
files:
M Doc/reference/datamodel.rst
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index 7d6cc34373b6c..d25357db43468 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -1931,7 +1931,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.
More information about the Python-checkins
mailing list