Metaclasses & docstrings in 2.2

Jeremy Bowers jerf at jerf.org
Wed Jul 24 16:36:00 EDT 2002


On Wed, 24 Jul 2002 05:49:13 -0500, Alex Martelli wrote:

> When your __init__ (or any other method) *just*
> delegates to the superclass, and nothing else,
> simply remove that method's definition from
> your class -- inherit it rather than going to
> the trouble of overriding just to delegate,
> which buys you nothing.

I know; I was trying to cut down the code I posted to just enough to show
the "problem" I was wondering about. I figured it was PEBKAC, and lo, it
was.  My *real* metaclass does more.

I did get the request for more information, which I'll get to a bit later
tonight when I have the code at hand. The reasons I'm using it are a bit
complicated, but it's a cool and very simple use that could be extremely
useful if one was building a framework with some sort of automatic,
pickle-based persistance. (Which I sorta am, though it's not meant to be a
framework, that's just how the design came out...)



More information about the Python-list mailing list