]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-15243: Document __prepare__ as classmethod (GH-17124)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 25 Jan 2020 19:04:55 +0000 (11:04 -0800)
committerBerker Peksag <berker.peksag@gmail.com>
Sat, 25 Jan 2020 19:04:55 +0000 (22:04 +0300)
(cherry picked from commit 7de617455ed788e6730c40cf854c4b72b0432194)

Co-authored-by: alclarks <57201106+alclarks@users.noreply.github.com>
Doc/reference/datamodel.rst

index 7d6cc34373b6c6625edf629a07f7b1eee42177cb..d25357db43468933a76cd0400030b3015dac96aa 100644 (file)
@@ -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.