title: AttributeError: 'module' object has no attribute 'modules'
body: <p>This is related to a SO question, the solution to which gives me the error noted.</p>
  
  <p><a href="https://stackoverflow.com/questions/1796180/python-get-list-of-all-classes-within-current-module">How can I get a list of all classes within current module in Python?</a></p>
  
  <p>Using the green-checked code from that SO answer, I want to get a list of all class names in my own module, locations.py:</p>
  
  <pre><code>import locations
  
  def print_classes():
      for name, obj in inspect.getmembers(locations.modules[__name__]):
          if inspect.isclass(obj):
              print obj
  
  print_classes()
  </code></pre>
  
  <p>When I run this, I get AttributeError: 'module' object has no attribute 'modules'</p>
  
  <p>I have tested locations.py -- it contains 31 skeleton classes; it throws no errors. </p>