]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-15243: Document __prepare__ as classmethod (GH-17124)
authoralclarks <57201106+alclarks@users.noreply.github.com>
Sat, 25 Jan 2020 18:49:58 +0000 (18:49 +0000)
committerBerker Peksag <berker.peksag@gmail.com>
Sat, 25 Jan 2020 18:49:58 +0000 (21:49 +0300)
Doc/reference/datamodel.rst

index 1442fbeb33d767596d07e128ef87b27941741f3c..9520f824287f6b05ac10d732fbf6623d3573dc4f 100644 (file)
@@ -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.