Navigation Menu

Skip to content

Commit

Permalink
bpo-15243: Document __prepare__ as classmethod (GH-17124)
Browse files Browse the repository at this point in the history
  • Loading branch information
alclarks authored and berkerpeksag committed Jan 25, 2020
1 parent aef7dc8 commit 7de6174
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Doc/reference/datamodel.rst
Expand Up @@ -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.
Expand Down

0 comments on commit 7de6174

Please sign in to comment.