title: How to instantiate class by it's string name in Python from CURRENT file?
body: <p>Suppose I have <code>myfile.py</code> with some classes <code>A</code>, <code>B</code> and <code>C</code> defined INSIDE it. Now I want to instantiate class by it's name in str. I don't understand what to pass to <code>getattr</code> in order to do this. All <a href="https://stackoverflow.com/a/4821120/258483">examples like this</a> assume that classes are in other module:</p>
  
  <pre><code>module = __import__(module_name)
  class_ = getattr(module, class_name)
  instance = class_()
  </code></pre>
  
  <p>but I don't have <code>module_name</code>.</p>