title: Creating a class in python using a string as the class name
body: <p>I have been looking for this for quite sometime and also looked at previously asked questions like:</p>
  
  <p><a href="https://stackoverflow.com/questions/3451779/how-to-dynamically-create-an-instance-of-a-class-in-python">how to dynamically create an instance of a class in python?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/452969/does-python-have-an-equivalent-to-java-class-forname">Does python have an equivalent to Java Class.forName()?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/553784/can-you-use-a-string-to-instantiate-a-class-in-python">Can you use a string to instantiate a class in python?</a></p>
  
  <p>And also many more, in some of them they are importing the class or using the name of the class somehow in definition.</p>
  
  <p>Edit:</p>
  
  <p>I need to take a list as input and create classes with strings in the list as their name.</p>
  
  <pre><code>store_list = {'store1', 'storeabc', 'store234'}
  </code></pre>
  
  <p>Now i can do,</p>
  
  <pre><code>store1 = type(store_list[0], (models.Model,), attrs)
  storeabc = type(store_list[1], (models.Model,), attrs)
  store234 = type(store_list[2], (models.Model), attrs)
  </code></pre>
  
  <p>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.</p>