I have been looking for this for quite sometime and also looked at previously asked questions like:
how to dynamically create an instance of a class in python?
Does python have an equivalent to Java Class.forName()?
Can you use a string to instantiate a class in python?
And also many more, in some of them they are importing the class or using the name of the class somehow in definition.
Edit:
I need to take a list as input and create classes with strings in the list as their name.
store_list = {'store1', 'storeabc', 'store234'}
Now i can do,
store1 = type(store_list[0], (models.Model,), attrs)
storeabc = type(store_list[1], (models.Model,), attrs)
store234 = type(store_list[2], (models.Model), attrs)
But i still have to use the names of the class in some way in the code, i have no way of knowing what the list will be, and i want the classes to be created with name taken from the list.