What should I use instead of assignment-in-an-expression in Python?
<p>according to <a href="http://pyfaq.infogami.com/why-can-t-i-use-an-assignment-in-an-expression" rel="nofollow">this page</a> one can't use code like</p>

<pre><code>if variable = something():
#do something with variable, whose value is the result of something() and is true
</code></pre>

<p>So in case I want to have the following code structure:</p>

<pre><code>if a = something():
#do something with a
elif a = somethingelse():
#...
#5 more elifs
</code></pre>

<p>where something() functions are compute-intensive (I mean that using the function and then doing it again to assign value to a variable in case the first one was true can't be done), what should I write instead in Python? Add 7 more variables instead of 1?</p>
