[Python-3000] Compiling the PEP 3115 metaclass syntax

Nicko van Someren nicko at nicko.org
Thu Mar 15 14:30:15 CET 2007


On 15 Mar 2007, at 04:33, Tony Lownds wrote:
> Does **kwds need to be passed to prepare and also to metaclass  
> constructor?
> Removing that would make it easier to provide nice error messages.
> Custom __prepare__
> implementations can always store the **kwds that are needed in or  
> on the
> dictionary-like object.

If you don't pass it to both the constructor and the preparer then  
all metaclasses which take keyword arguments must have a __prepare__  
function whether they have custom local storage or not.  This seems  
to be non-obvious and it also unnecessarily conflates the issues of  
custom locals storage and passing arguments to metaclasses.

	Nicko



More information about the Python-3000 mailing list