Hooks, aspect-oriented programming, and design by contract

Neil Schemenauer nas at python.ca
Tue Jan 22 13:49:28 EST 2002


gbreed at cix.compulink.co.uk wrote:
> I think my brain's about to explode.

2.2 to the rescue (it's really not that bad).

> A metaclass is a class that produces classes, right?  How would an
> object know what its metaclass is?

In Python 2.2:

    >>> class A(object):
    ...   pass
    ... 
    >>> A().__class__.__class__
    <type 'type'>

IOW, new style objects have 'type' as the metaclass.

  Neil




More information about the Python-list mailing list