Python: instantiating new instance of class from list of classes
<p>Disclaimer: This may be a terribly simple question but I'm attempting to learn Python.</p>

<p>Essentially, I have a list of classes and given a random number, I'd like to construct a new instance of the class indexed at that random number.  </p>

<pre><code>  #The members of the list below are class objects  
  SHAPES = [I_shape, J_shape, L_shape, O_shape, S_shape, T_shape, Z_shape]
</code></pre>

<p>I've discovered how to do it given a string so I guess I could just use the name attribute of the class but I'm curious if there isn't an easier way to go about this.</p>

<p>Any thoughts?</p>
