Another way to spell __metaclass__ ?

Thomas Heller theller at python.net
Fri Dec 13 15:17:16 EST 2002


Mike Dean <klaatu at evertek.net> writes:

> On 13 Dec 2002 19:34:04 +0100 Thomas Heller <theller at python.net> wrote:
> > Didn't Michael Hudson some time ago have a patch which allowed
> > to write something like this?
> 
> > class IUnknown(bases) [interface]:
> >    ...
> 
> > or
> 
> > def IUnknown() [a, b, c]:
> >    ...
> 
> I think I remember seeing something like that a long time ago (well,
> long time relative to my Python activity).  Was it for metaclasses, or
> was it for some kind of interface mechanism?

IIRC, the list on the right was a list of callables which would have
been invoked before or after the object on the left (class or
function) is or was created.  So it could be used to make class- or
static methods, or to hook the class creation.

I don't know how long your Python activity is, but I think it was this
year.  Maybe a search on the python-dev archives will find it.

Thomas



More information about the Python-list mailing list