[Python-3000] PEP for Metaclasses in Python 3000

Guido van Rossum guido at python.org
Tue Mar 13 04:03:06 CET 2007


Unsure why you present this as a question; I'm not sure anyone has
thought much about it yet. I wonder if the call shouldn't be made like
this:

__prepare__(name, bases, **kwargs)

so that if you only expect certain specific keyword args you can
define it like this:

def __prepare__(name, base, metaclass=X): ...

On 3/12/07, Steven Bethard <steven.bethard at gmail.com> wrote:
> On 3/12/07, Guido van Rossum <guido at python.org> wrote:
> > On 3/9/07, Brett Cannon <brett at python.org> wrote:
> > > Do the keywords have to follow the metaclass keyword, or is order
> > > irrelevant?  While order makes sense, it would be a new precedent for
> > > keyword arguments to have an important order.
> >
> > I'd like the syntax between () to be identical to that for a function
> > call, i.e. including *args and **kwds. That way the cognitive load for
> > the user is the smallest. Sorting out the semantics of the keywords is
> > purely a runtime activity anywaty.
>
> Just to clarify, while the syntax between the () in the class
> definition will be the same as that of a function call, the signature
> of the method called will be::
>     __prepare__(name, args, kwargs)
> not
>     __prepare__(name, *args, **kwargs)
> right?
>
> STeVe
> --
> I'm not *in*-sane. Indeed, I am so far *out* of sane that you appear a
> tiny blip on the distant coast of sanity.
>         --- Bucky Katt, Get Fuzzy
>


-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list