What is the most pythonic way to load a class and instaniate an object
dynamically. Right now, I am using eval:
try:
load = eval('%s(props) ' % (props['plugin.generat e']))
except:
It works, doesnt seem very safe. Where props['plugin.generat e'] is a
class name string. And 'props' is the first arg in the constructor.
What do you think?
--
Ramza from Atlanta
dynamically. Right now, I am using eval:
try:
load = eval('%s(props) ' % (props['plugin.generat e']))
except:
It works, doesnt seem very safe. Where props['plugin.generat e'] is a
class name string. And 'props' is the first arg in the constructor.
What do you think?
--
Ramza from Atlanta
Comment