Return a value coming directly from a function call vs. an intermediate variable <p>I have a function f(x), which does something and return values (a tuple).</p> <p>I have another function that call this function , after processing parameters (the whole function operation is irrelevant to the question); and now I would like to know if there are evil intent in returning the function itself, vs runt the function, dump the output in a variable and return the variable.</p> <p>A variable has a cost, and assign a value to a variable has a cost; but beside that, is there any sorcery that would happen behind the scene, that would make one better than the other ?</p> <pre><code>def myfunction(self): [do something] return f(x) </code></pre> <p>is the same as </p> <pre><code>def myfunction(self): [do something] b = f(x) return b </code></pre> <p>or one is to prefer to the other (and why)? I am talking purely on the OOP persepctive; without considering that create variables and assign has a cost, in terms of memory and CPU cycles.</p>