title: How to make a dictionary comprehension with inline if?
body: <p>I am trying to combine a dictionary comprehension and an inline <code>if</code> statement.
  The comprehension loops over all items and as long as the item has not the key <code>id</code>
  it creates a new key: <code>job[old_key]</code>.</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>job = {'id':1234, 'age':17, 'name':'dev'}
  args = {'job[%s]' % k:v if k != 'id' else k:v for k, v in job}
  </code></pre>
  
  <p><strong>Wished output</strong></p>
  
  <pre><code>print args
  {'id':1234, 'job[age]':17, 'job[name]':'dev'}
  </code></pre>
  
  <p>A <code>SyntaxError</code> was raised.</p>
  
  <pre><code>args = {'job[%s]' % k:v if k != 'key' else k:v for k, v in job}
                                              ^
  SyntaxError: invalid syntax
  </code></pre>
  
  <p>However, when I try to run my script Python complains about <code>k:v</code>.
  How can I combine a dictionary comprehension and an inline if statement?</p>
  
  <p><strong>Note</strong>: I know that I can easily achieve that task with a <code>for</code> loop, but I just want 
  to combine these two elements.</p>