Alex Martelli wrote:
> The best way to make classes on the fly is generally to call the
> metaclass with suitable parameters (just like, the best way to make
> instances of any type is generally to call that type):
>
> derived = type(base)('derived', (base,), {'__doc__': 'zipp'})
and George Sakki
"Mikael Olofsson" <[EMAIL PROTECTED]> wrote:
> Hi!
>
> I've asked Google, but have not found any useful information there.
>
> Situation: I have a base class, say
>
> >>> class base(object):
> ImportantClassAttribute = None
>
> Now, I want to dynamically generate subclasses of base. That
Mikael Olofsson <[EMAIL PROTECTED]> wrote:
...
> Any ideas? Am I stuck with the clumsy exec-solution, or are there other
> ways to dynamically generate doc-strings of classes?
The best way to make classes on the fly is generally to call the
metaclass with suitable parameters (just like, the bes