I have read many questions about this problem (like this one), suppose I have a string 'foo' and i want to instantiate an object named foo of a particular type. What I would like to do is to be able to dynamically build an object adding properties extracted from an XML file (using the Bunch pattern).
The problem I have is to name the "root" object(the bunch or the container) according to a particular string.
EDIT I've realized that I could do something like
exec('%s = Bunch' % 'foo')
My bad