title: Write to dictionary using list-path
body: <p>I would like to write to a dictionary with a 'list-path'. I have:</p>
  <pre class="lang-py prettyprint-override"><code>container = {}
  path = ['foo', 'bar']
  data = [1, 2, 3]
  </code></pre>
  <p>And would like to get</p>
  <pre class="lang-py prettyprint-override"><code>container = {
      'foo' : {
          'bar' : [1, 2, 3]
      }
  }
  </code></pre>
  <p>To read, I am very enthusiastic about <a href="https://stackoverflow.com/a/31033676/2646505">this answer</a>, which says that <strong>to read</strong>:</p>
  <pre class="lang-py prettyprint-override"><code>data = functools.reduce(operator.getitem, path, container)
  </code></pre>
  <p>But now I'm not managing to get the opposite right...</p>
  <p>(I guess one could use recursion, but a one-line solution seems near!)</p>