 <p>In my test, if you have exactly as many variables as items in your return, then it works.</p> <pre><code>def algo(): return range(5) a5 = algo() # works b1,b2,b3,b4,b5 = algo() # works c1,c2,c3 = algo() # doesn't work d1,d2,d3,d4,d5,d6 = algo() # doesn't work. </code></pre>