how to dynamically instantiate an object inheriting from several classes?

Joe Strout joe at strout.net
Fri Nov 21 17:48:57 EST 2008


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?

Thanks,
- Joe





More information about the Python-list mailing list