multiple extensions to a class

Michele Simionato michele.simionato at gmail.com
Mon Jul 12 06:24:14 EDT 2004


"Humpty Dumpty" <oliver.schoenborn at utoronto.ca> wrote in message news:<JqnIc.1771$RD4.334862 at news20.bellglobal.com>...
> 
> No because B,C and D are discovered at run-time only, ie class E can't be
> known until runtime. You'd have to create a string with the code and use
> exec or eval or s/t similar.

Not at all. You can create classes at run-time with "type":

type("MyDynamicClass",bases_set_at_run_time,dict_set_at_run_time)

                Michele Simionato



More information about the Python-list mailing list