Dynamically call python-class defined in config-file
<p>I have a config.cfg which I parse using the python-module ConfigParser. In one section I want to configure assignments of the form <code>fileextension : ClassName</code>. Parsing results in the following dictionary:</p>

<pre><code>types = {
  "extension1" : "ClassName1",
  "extension2" : "ClassName2"
}
</code></pre>

<p><em>EDIT: I know I can now do:</em></p>

<pre><code>class_ = eval(types[extension])
foo = class()
</code></pre>

<p><em>But I was given to understand that <code>eval</code> is evil and should not be used.</em></p>

<p><strong>Do you know a nicer way to dynamically configure which file-extension results in which class?</strong></p>
