title: How to convert a string containing a list of dict into Python object?
body: <pre><code>ugly = "[{'ride': 1, 'pickup_time': datetime(2016, 3, 17, 15, 36, 35, 976202)},
           {'ride': 2, 'pickup_time': datetime.datetime(2016, 3, 17, 15, 41, 35, 976202)}]"
  # The actual variable contains a lot more dictionnaries...`
  </code></pre>
  
  <p>I'd like to convert the ugly variable as a real Python object.
  I tried <code>json.loads()</code> and <code>ast.literal_eval()</code> but it's for one dict only.</p>
  
  <p>That's why, before that, I tried to split this string into several dictionnaries, but the <code>split()</code> method has only one delimiter, so it seems I could need a REGEX to do this.</p>
  
  <p>What is the simplest way to do it? Thanks.</p>