Skip to content

Commit 321491a

Browse files
miss-islingtonalclarks
authored andcommitted
bpo-15243: Document __prepare__ as classmethod (GH-17124)
(cherry picked from commit 7de6174) Co-authored-by: alclarks <[email protected]>
1 parent 079dfe0 commit 321491a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Doc/reference/datamodel.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1945,7 +1945,8 @@ Preparing the class namespace
19451945
Once the appropriate metaclass has been identified, then the class namespace
19461946
is prepared. If the metaclass has a ``__prepare__`` attribute, it is called
19471947
as ``namespace = metaclass.__prepare__(name, bases, **kwds)`` (where the
1948-
additional keyword arguments, if any, come from the class definition).
1948+
additional keyword arguments, if any, come from the class definition). The
1949+
``__prepare__`` method should be implemented as a :func:`classmethod`.
19491950

19501951
If the metaclass has no ``__prepare__`` attribute, then the class namespace
19511952
is initialised as an empty ordered mapping.

0 commit comments

Comments
 (0)