It&#x27;s not bad necessarily to do it that way inline in another function, because there&#x27;s no way to use it elsewhere without realizing that it has the side effect of emptying the list. However since this is recursive that&#x27;s not realistically how it would be used.<p>It wouldn&#x27;t be bad if it were obvious what it did, which it isn&#x27;t with the name &quot;sum&quot;, but would be with the name &#x27;sum_and_empty&quot;. For good measure, maybe &quot;sum_in_linear_space_and_empty&quot; is even better.<p>It&#x27;s also less efficient (although in the context of a recursive sum definition that&#x27;s not too relevant). Essentially what you&#x27;re doing here is using the length of the list as the iteration variable — the `i&#x27; in `for (i = n-1; i &gt;= 0; i--)&#x27;. But `pop()&#x27; probably does more than decrement the length field, I imagine it also does some memory management bookkeeping at least.<p>I also take issue with how `list&#x27; is mutated and accessed in the same expression. I don&#x27;t really use python, but I think I recall reading that it in fact guarantees left-to-right evaluation of such expressions. Even still, it&#x27;s confusing and makes programmers, especially those who write C&#x2F;C++ where this is undefined behavior, uneasy.