<div dir="ltr"><div class="gmail_extra"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_quote">I would have preferred this signature to start with, but it's easy to wrap.
</div></blockquote>Indeed, but a default value for the first argument requires a default value for all arguments. It's a syntax error, but I agree a "range-like" signature like that would be better.<br><br>My reference scan implementation (that's how I thought itertools.accumulate should be):<br><a href="https://github.com/danilobellini/pyscanprev/blob/v0.1.0/pyscanprev.py#L171" target="_blank">https://github.com/danilobelli<wbr>ni/pyscanprev/blob/v0.1.0/pysc<wbr>anprev.py#L171</a><br><br></div><div class="gmail_extra">A new "functools.scan" with a signature like the one from the link above would be nice, but it would overlap with itertools.accumulate in some sense. The advantages would be:<br><br></div><div class="gmail_extra"><div class="gmail_extra">1 - The scan signature and the functools.reduce signature are the same (the function as the first parameter, like map/filter)<br></div>2 - The module, functools, is the same that has the reduce function<br></div><br><div class="gmail_extra">-- <br><div class="m_-4543930243243609401gmail-m_7082904489917914937gmail-m_1196149325384198239gmail_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>