<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2016-10-25 12:29 GMT-02:00 Paul Moore <span dir="ltr"><<a href="mailto:p.f.moore@gmail.com" target="_blank">p.f.moore@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On the other hand, the *ideas* are really interesting and valuable.<br>
I'm certainly planning on looking at PyScanPrev when I get the chance.<br>
And the discussions can frequently make people rethink their beliefs.<br>
<br>
So people posting ideas here should expect pushback - and should be<br>
prepared to learn how to think about the wider context in which<br>
changes to Python need to exist. That pushback won't[1] be hostile or<br>
negative, although it can feel that way to newcomers. But if a poster<br>
is inclined to take challenges to their idea personally, and even more<br>
so if they respond negatively, things can get tense. So please don't<br>
:-)<br>
<br>
So, bringing this back on topic - Danilo, what is your justification<br>
for suggesting that this technique should be language syntax, as<br>
opposed to simply being a 3rd party module (which you've already<br>
written, which is great)? Do you know what sorts of things would be<br>
viewed as evidence in favour of promoting this to syntax, or can we<br>
help in clarifying the sort of evidence you'd need to collect? Are the<br>
relevant design guidelines (things like "there should be one obvious<br>
way to do it" that frequently get quoted around here without much<br>
explanation) clear to you, or do you have questions?<br>
<br>
Hopefully we can change your mind about how inviting you find us :-)<br>
</blockquote></div><br></div><div class="gmail_extra">Thanks for your message, Paul.<br>When I said the list isn't inviting, I'm not talking about everyone, but about quite few people that disturbs.<br></div><div class="gmail_extra">I'm just trying to help improving the language.<br><br></div><div class="gmail_extra">I'm waiting for your opinion about PyScanPrev. =)<br><br><br>2016-10-25 16:01 GMT-02:00 Brendan Barnwell <span dir="ltr"><<a href="mailto:brenbarn@brenbarn.net" target="_blank">brenbarn@brenbarn.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Recurrence relations are much more general than just "have access to the
 previous value".  They may have access to any of the earlier values, 
and/or multiple earlier values.  So if what we wanted was to able to use
 recurrence relations, your proposal would be insufficient.</blockquote></div><div class="gmail_extra"><br></div><div class="gmail_extra">Brendan, please see the PyScanPrev examples, mainly the Fibonacci and the State-space model examples. Recursion is enough to give you that. The proposal isn't about lag and windowing, but if you've got an idea to improve that, I'd like to know.<br><br><br>2016-10-25 15:55 GMT-02:00 Rob Cliffe <span dir="ltr"><<a href="mailto:rob.cliffe@btinternet.com" target="_blank">rob.cliffe@btinternet.com</a>></span>:<br>
  
    
  
  <span class="gmail-">
    </span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-"><div class="gmail-m_2622384706419112807moz-cite-prefix">On 24/10/2016 06:11, Danilo J. S.
      Bellini wrote:</div></span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div> <span style="font-family:monospace,monospace">>>> [prev * k for k in [5, 2, 4, 3] from prev = 1]</span><br><span style="font-family:monospace,monospace"></span><div><span style="font-family:monospace,monospace">[1, 5, 10, 40, 120]</span><br></div><div><br></div><div>That makes sense for me, and seem simpler than:<br><br></div><div><span style="font-family:monospace,monospace">>>> from itertools import accumulate, chain<br></span></div><span style="font-family:monospace,monospace">>>> list(accumulate(chain([1], [5, 2, 4, 3]), lambda prev, k: prev * k))<br>[1, 5, 10, 40, 120]</span></div></blockquote><span class="gmail-"></span><span class="gmail-"></span>Well, if you want an instant reaction from someone skimming this
    thread: I looked at the first example and couldn't understand it. 
    Then I looked at the second one, and could understand it (even
    though I may never have used "chain" or heard of "accumulate"). 
    Obviously your mileage varies.<br></blockquote><br></div><div class="gmail_extra">Rob, would it be the same if it was the other way around? I'm also somewhat familiar with map/filter, but I think you would need more time (and documentation) to understand what the second does if you hadn't seen the first. What do you think?<br></div><div class="gmail_extra"><br><br>2016-10-25 23:36 GMT-02:00 David Mertz <span dir="ltr"><<a href="mailto:mertz@gnosis.cx" target="_blank">mertz@gnosis.cx</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>After reading every post in the thread, I still don't understand the proposed new syntax really.</div></blockquote><div> </div></div><div class="gmail_extra">The proposal is to create a new syntax for recursive set/list/dict comprehensions and generator expressions. And that's all.<br>It could be a new magic keyword as you said, but there are alternatives like the "from" example I gave.<br><br><br>2016-10-25 23:36 GMT-02:00 David Mertz <span dir="ltr"><<a href="mailto:mertz@gnosis.cx" target="_blank">mertz@gnosis.cx</a>></span>:<br></div><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">If you give up a fear of using `import` and stop arbitrarily converting a possibly infinite iterator to a concrete list<br></blockquote><br></div><div class="gmail_extra">Ad hominem, and that's just offensive. Who said I "fear" an import? Who is "converting a possibly infinite iterator to a concrete list"?!<br></div><div class="gmail_extra">You know that "it was a built-in, now it's in a module" is meaningful, and when it comes to what happened to "reduce", it's an argument for my proposal, not against it. Why should I fear?<br></div><div class="gmail_extra"></div><div class="gmail_extra"><br>-- <br><div class="gmail_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>