dictionary value operations shortcut
<p>I am wondering why arithmetic operations on dictionary values cannot be shortened with <code>=+</code> or <code>=-</code> as normal python variables can:</p>

<pre><code>for item in myDict:
    myDict[item] =+ 1
</code></pre>

<p>doesn't seem to work, but instead I'm told to use:</p>

<pre><code>for item in myDict:
    myDict[item] = myDict[item] + 1
</code></pre>

<p>It doesn't seem very Pythonic to me, but perhaps there is a great explanation for this convention.</p>

<p>The order of the operators is <code>+=</code> and <code>-=</code>, not the other way around:</p>

<pre><code>In [31]: my_dict  = {'key1': 1, 'key2': 2}

In [32]: for item in my_dict:
   ....:     my_dict[item] += 1
   ....:

In [33]: my_dict
Out[33]: {'key1': 2, 'key2': 3} # values have been incremented by one
</code></pre>

python shortcuts dictionary