<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="m_-3388570518250938833gmail-im">
</span>Ah, that makes SIX existing solutions. Do we need a seventh?</blockquote>It might have dozens of solutions, perhaps an infinity of solutions. Brainfuck and assembly can be used, or even turing machine instructions...<br><br>But there should be one, and preferably only one, OBVIOUS way to do it. Readability counts.<br><div class="gmail_extra"><br></div><div class="gmail_extra">Reduce lost the built-in status on Python 3. Lambdas lost the decomposing arguments like "lambda (a, b), c: a + b * c". Using a for loop section inside a generator expression or list/set/dict comprehension allow the decomposing arguments and doesn't need a function to be imported. Actually, itertools.accumulate and functools.reduce have their parameters reversed, and accumulate doesn't have a "start" parameter.<br><br></div><div class="gmail_extra">Actually, the example I give in this thread is about a fold/reduce trying to show it's way simpler than the other solutions. I didn't paste here any scan use case because I sent links with several use cases, should I paste their contents here? The PyScanPrev link (<a href="https://github.com/danilobellini/pyscanprev" target="_blank">https://github.com/<wbr>danilobellini/pyscanprev</a>) has several use case examples (including some just for a comparison with other possible solutions) and even have a full rationale for this idea.<br></div><div class="gmail_extra"><br>-- <br><div class="m_-3388570518250938833gmail_signature">Danilo J. S. Bellini<br>---------------<br>"<i>It is not our business to set up prohibitions, but to arrive at conventions.</i>" (R. Carnap)<br></div>
</div></div>