From 2ca9a1402a241b721225f6effad003bce4f496fd Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 2 Aug 2007 16:51:59 +0000 Subject: [PATCH] Mention that type.__prepare__() exists for use via super(). --- pep-3115.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pep-3115.txt b/pep-3115.txt index fefb074d9..d6fd7a130 100644 --- a/pep-3115.txt +++ b/pep-3115.txt @@ -132,6 +132,10 @@ Invoking the Metaclass assignment algorithm. (Note also that 'metaclass' is a keyword- only argument as per PEP 3102 [6].) + Even though __prepare__ is not required, the default metaclass + ('type') implements it, for the convenience of subclasses calling + it via super(). + __prepare__ returns a dictionary-like object which is used to store the class member definitions during evaluation of the class body. In other words, the class body is evaluated as a function block