[Python-3000] PEP for Metaclasses in Python 3000 (original) (raw)

BJörn Lindqvist bjourne at gmail.com
Tue Mar 13 18:57:54 CET 2007


On 3/13/07, Guido van Rossum <guido at python.org> wrote:

> > I find this rather cool looking: > > > > class C(implements=(I1, I2)): ...

Me too. :-)

But... What does it do? PEP says:

In the new model, the syntax for specifying a metaclass is via a keyword argument in the list of base classes:

  class Foo(base1, base2, metaclass=mymeta):
    ...

Additional keywords will also be allowed here, and will be passed to the metaclass, as in the following example:

  class Foo(base1, base2, metaclass=mymeta, private=True):
    ...

Who is the receiver of the implements keyword argument in your example? Should it not be class class C(metaclass = SomethingHere, implements = (I1, I2))?

-- mvh Björn



More information about the Python-3000 mailing list