On 22 November 2017 at 16:53, Paul Moore <p.f.mo...@gmail.com> wrote:
> On 22 November 2017 at 15:10, Ivan Levkivskyi <levkivs...@gmail.com> > wrote: > > I think there may be a small misunderstanding here. The situation is > > different for comprehensions and generator expressions, > > let me summarize the current state: > [...] > > What do you think? > > Can you point me to where in the docs it explains the semantic > difference between a generaor expression and a list comprehension? > Ignoring the trivial point that they return different values - think > of [a for a in expr] vs list(a for a in expr) if you like - these > should be semantically the same, I believe? > > TBH, the docs aren't super-precise in this area. Before we start > debating the "correct" behaviour of edge cases, I think we need to > agree (and document) the semantics more precisely. > > Paul > Looking at https://docs.python.org/3/reference/expressions.html?highlight=generator%20expression#generator-expressions it is indeed not super clear what it _should_ mean. I agree this requires documentation updates. -- Ivan
_______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com