title: Can I remove double evaluation whilst keeping lambda expression
body: <pre><code>def bar(x):
      # some expensive calculation
      &lt;snip&gt;
  
  foo = lambda(x): bar(x) if bar(x) &gt; 10 else 0
  </code></pre>
  
  <p>However here I have calculated foo twice. Is there a way to still write this as a one liner but avoid the double evaluation. I tried</p>
  
  <pre><code>foo = lambda(x): v if (v = bar(x)) &gt; 10 else 0
  </code></pre>
  
  <p>but that doesn't work.</p>