make a class instance from a string ?

Mike Woodhouse mikewoodhouse at gmail.com
Fri Feb 24 09:37:27 EST 2006


Is there anything particularly bad with

obj = eval(classname + "()")

?

It appears to work, but I'm a noobie so I could be missing something
nasty, in which any edication would be gratefully received.

Mike




More information about the Python-list mailing list