title: Parse nested list from string that cannot be parsed with ast.literal_eval
body: <p>I parse a file to a Python list and I encountered a nested list like this:</p>
  <pre class="lang-none prettyprint-override"><code>{   1   4{  2a  0.0 }{  3   0.0 }{  4c  0.0 }{  5   0.0 }   }
  </code></pre>
  <p>I want to interpret it as a list, yet nested, so I want to be the resulting Python list as follows:</p>
  <pre class="lang-none prettyprint-override"><code>[1,4,[2a,0.0],[3,0.0],[4c,0.0],[5,0.0]]
  </code></pre>
  <p>I manage to do a correct string of this with a following:</p>
  <pre><code>l = &quot;&quot;&quot;{    1   4{  2   0.0 }{  3   0.0 }{  4   0.0 }{  5   0.0 }   }&quot;&quot;&quot;
  l = l.replace(&quot;{\t&quot;,&quot;,[&quot;).replace(&quot;\t}&quot;,&quot;]&quot;).replace(&quot;{&quot;,&quot;[&quot;).replace(&quot;}&quot;,&quot;]&quot;).replace(&quot;\t&quot;,&quot;,&quot;)[1:]
  </code></pre>
  <p>I can also apply <code>l.strip(&quot;\t&quot;)</code> so that it is a list, but not for a nested, otherwise it will be flattened, which I do not want.</p>
  <p>I tried with <code>ast.literal_eval(l)</code>, but it fails on strings e.g. <code>2a</code></p>