python ast.literal_eval and datetime
<p>I have a string <code>{'datetime': datetime.datetime(2010, 11, 21, 0, 56, 58)}</code> and I want to convert this to the object it represents.  Using <code>ast.literal_eval()</code> gives </p>

<pre><code>ValueError: malformed string; 
</code></pre>

<p>because it does not allow for construction of objects (i.e. the datetime call). Is there anyway to either get ast to process this correctly, or to secure eval to prevent code injection?</p>
