bpo-15243: Document prepare as classmethod (GH-17124) · python/cpython@7de6174 (original) (raw)

Original file line number Diff line number Diff line change
@@ -1945,7 +1945,8 @@ Preparing the class namespace
1945 1945 Once the appropriate metaclass has been identified, then the class namespace
1946 1946 is prepared. If the metaclass has a ``__prepare__`` attribute, it is called
1947 1947 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`.
1949 1950
1950 1951 If the metaclass has no ``__prepare__`` attribute, then the class namespace
1951 1952 is initialised as an empty ordered mapping.