title: Right way to get var[a][b][c] when keys may not exist
body: <p>I have a nested data structure (a DynamicRecord, but I think it might as well be a nested list or anything else you can index with <code>object.__getitem__</code>) and would like to extract a value from it. Let’s call it var:</p>
  <pre><code>extracted = var[a][b][c]
  </code></pre>
  <p>will work just fine if var[a], var[a][b], and var[a][b][c] exist. So I can do</p>
  <pre><code>try:
      extracted = var[a][b][c]
  except:
      extracted = None
  </code></pre>
  <p>But I have to do this many times (with different a, b, c and possibly more or fewer nestlings) and it seems repetitive. What’s the most Pythonic way to do this?</p>
  <p>At the moment I’m calling a variadic helper function</p>
  <pre><code>extracted = drill_down(var, a, b, c)
  </code></pre>
  <p>but is this really the best way?</p>