title: Passing class names to dictionary (and parsing order)
body: <p>I have some code that looks like the following:</p>
  
  <pre><code>class Action(object):
      ...
  
  class SpecificAction1(Action):
      ...
  
  class SpecificAction2(Action):
      ...
  </code></pre>
  
  <p>They are all specified in the same file. Before their specification I want to put a dictionary that looks like this:</p>
  
  <pre><code>ACTIONS = {
      "SpecificAction1": SpecificAction1,
      "SpecificAction2": SpecificAction2
  }
  </code></pre>
  
  <p>The idea is that I can simply import the ACTIONS dictionary from other modules and have this one dictionary be the one canonical string representation of the actions (they are sent over the network and other places where I need some identifier).</p>
  
  <p>Is it possible to do "class pointers" like this in the same way you do function pointers? And my editor complains that names are undefined before the dictionary is declared before the class definitions - is this true?</p>
  
  <p>Also, if the above is possible can I do this to instantiate a class: <code>ACTIONS['SpecificAction2']()</code>?</p>