Re: Dynamic generation of doc-strings of dynamically generated classes

2005-10-18 Thread Mikael Olofsson
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 Sakkis

Dynamic generation of doc-strings of dynamically generated classes

2005-10-17 Thread Mikael Olofsson
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's not a problem. However, I very much want those subclasses to

Re: Dynamic generation of doc-strings of dynamically generated classes

2005-10-17 Thread Alex Martelli
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 best

Re: Dynamic generation of doc-strings of dynamically generated classes

2005-10-17 Thread George Sakkis
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's not a