Is there a shorthand for repeated reassignment of a variable?
<p>Consider the example:</p>

<pre><code>x = 27
x = sqr(x)
x += 2
x = x * 0.1
</code></pre>

<p>This could trivially be reduced to</p>

<pre><code>x = 0.1 * (sqr(27) + 2)
</code></pre>

<p>Now, consider (x as an OrderedDict)</p>

<pre><code>x = {k: bubble_sort(v) for k, v in x.items()}

x = {k: rename(k) for k, v in x.items()}

x = {k: abs(k) for k, v in x.items()}
</code></pre>

<p>Is there a shorthand trick to avoid repeating the variable assignment? For example, is there a function such that:</p>

<pre><code>def pipeline(x, function_handles):
    ....
    for f in function_handles:
        x.apply(f) #in place
return x
</code></pre>

<p>or</p>

<pre><code>def pipeline(x, expression):
    ....
    for ex in expression:
        ex(x) #in place
return x
</code></pre>