title: Pythonic and compact way to compare the key in dict
body: <p>Just want to know a good way how to do this:</p>
  
  <pre><code>a = {'key':'value'}
  if 'key' in a:
      if a['key'] == 'value':
          # do something ...
  </code></pre>
  
  <p>The problem is sometimes I need to handle cases whe <code>"key"</code> is actually <code>"@key"</code>, So I don't want to duplicate the same code with <code>if '@key' in a: ....</code> </p>
  
  <p>So the question is how to handle both cases in most Pythonic and more compact way?</p>