how to dynamically instantiate an object inheriting from several classes?

Ned Deily nad at acm.org
Fri Nov 21 20:06:33 EST 2008


In article <0E0333C1-9515-4736-A839-F59AAD675D4E at strout.net>,
 Joe Strout <joe at strout.net> wrote:
> On Nov 21, 2008, at 3:30 PM, Arnaud Delobelle wrote:
> > Of course it's possible: use type(name, bases, dict).
> Thanks, I never knew about that form of type().  Neither does the  
> 2.5.2 reference manual, whose only index entry for the type() function  
> is <http://www.python.org/doc/2.5.2/ref/objects.html#l2h-21>, and that  
> speaks only about the traditional use of type() to check the type of  
> an object.
> 
> help(type) does mention the form you show, though it doesn't explain  
> what the dict is for.
> 
> Where would I find documentation on this nifty function?

Where built-in functions are documented, the Python Library Reference:

<http://www.python.org/doc/2.5.2/lib/built-in-funcs.html>

-- 
 Ned Deily,
 nad at acm.org




More information about the Python-list mailing list