title: Multi-level defaultdict with variable depth?
body: <p>I have a large list like:</p>
  
  <pre><code>[A][B1][C1]=1
  [A][B1][C2]=2
  [A][B2]=3
  [D][E][F][G]=4
  </code></pre>
  
  <p>I want to build a multi-level dict like:</p>
  
  <pre><code>A
  --B1
  -----C1=1
  -----C2=1
  --B2=3
  D
  --E
  ----F
  ------G=4
  </code></pre>
  
  <p>I know that if I use recursive defaultdict I can write <code>table[A][B1][C1]=1</code>, <code>table[A][B2]=2</code>, but this works only if I hardcode those insert statement. </p>
  
  <p>While parsing the list, I don't how many []'s I need beforehand to call <code>table[key1][key2][...]</code>.</p>