Something
public text v1 · immutableclass Factory:
def __init__(self, name):
if not name:
print "Name is not set, please provide type"
else:
self.name=name
print "All looks good so far - trying to create class." + self.name
try:
__import__(name);
# return name()
except Exception,e:
print "Cannot instantiate proper subclass - Class : %s"%e
==== invocation
li=['A','B','C']
chosen=li[0]
o=Factory(chosen)
print o.name