title: Python shorthand for conditionally assigning a variable
body: <p>I find myself writing stuff like this too often and it seems too wordy:</p>
  
  <pre><code>obj = my_dict.get('obj')
  if obj:
      var = obj
  </code></pre>
  
  <p>Is there a better way to do this? Maybe in one line?</p>