metaclasses vs. inheritance

Mark McEahern marklists at mceahern.com
Fri Jun 28 11:20:43 EDT 2002


> Can someone give an example of a problem that is solved with metaclasses,
> which would be difficult or impossible to solve with inheritance?

You can intervene in class creation to do aspect-oriented type stuff.  E.g.,
before each method call, do this, after each method call, do that.  Etc.  I
will post a more detailed example as the start of a separate thread shortly.

// m

-






More information about the Python-list mailing list