else vs return to use in a function to prematurely stop processing
<p>[Edit] changed <code>return 0</code> to <code>return</code>. Side effects of beinga Python n00b. :)</p>

<p>I'm defining a function, where i'm doing some 20 lines of processing. Before processing, i need to check if a certain condition is met. If so, then I should bypass all processing. I have defined the function this way.</p>

<pre><code>def test_funciton(self,inputs):
    if inputs == 0:
        &lt;Display Message box&gt;
        return
    &lt;20 line logic here&gt;
</code></pre>

<p>Note that the 20 line logic does not return any value, and i'm not using the 0 returned in the first 'if'.</p>

<p>I want to know if this is better than using the below type of code (in terms of performance, or readability, or for any other matter), because the above method looks good to me as it is one indentation less:</p>

<pre><code>def test_function(self,inputs):
    if inputs == 0:
        &lt;Display Message box&gt;
    else:
        &lt;20 line logic here&gt;
</code></pre>
