Function with multiple options of returns
<p>Sorry, if this question was already answered, I couldn't think of a better way to describe this problem :/</p>

<p>Let's say I have a function like this:</p>

<pre><code>def func(arg):
    if arg something:
        return a, b, c, d
    else:
        return False
</code></pre>

<p>So, when i call this function like this:</p>

<pre><code>a, b, c, d = func(arg)
</code></pre>

<p>and it happens, that the function only returns False -would this create a problem (since I'm assigning 4 variables but only getting 1 bool) ? </p>

<p>Yes, this would cause a problem.  Generally you don't want to do something like this, it often leads to unexpected errors later on that are difficult to catch.  Python allows you to break the rules by returning whatever you want, but you should only do it if you have a good reason. As a general rule, your functions and methods should return the same type no matter what (with the possible exception of <code>None</code>).  </p>

python function return