[issue41591] Comprehensions documentation

2020-08-20 Thread Vedran Čačić
Vedran Čačić added the comment: On the contrary, I think it would be much more clearer if it focused on the one that was evaluated in the context. So, _inner_ listcomp is... (instead of "nested listcomp is..."). "Main part of outer" is just beating around the bush. But in fact I'm not motivat

[issue41591] Comprehensions documentation

2020-08-20 Thread Walid Taha
Walid Taha added the comment: That makes perfect sense now, and I see what threw me off. Basically, there were not enough cues for me to see that there was an extra pair of square brackets in the example that had nested listcomps, and as a result, I assumed that a nested listcomp simply mean

[issue41591] Comprehensions documentation

2020-08-20 Thread Vedran Čačić
Vedran Čačić added the comment: It refers to the sentence """The result will be a new list resulting from evaluating the expression in the context of the for and if clauses which follow it. """ The expression at the start of listcomp is the one that's evaluated in the context of clauses foll

[issue41591] Comprehensions documentation

2020-08-20 Thread Walid Taha
Walid Taha added the comment: Thank you, and good point, Vedran. That takes care of the example that I gave. What remains is the source of confusion, namely, the reference to the "previous section". With a quick search I was not able to find what this was referring to (other than the one tha

[issue41591] Comprehensions documentation

2020-08-20 Thread Vedran Čačić
Vedran Čačić added the comment: This is not nested listcomp. Nested listcomp is a listcomp inside a listcomp. What you wrote is one listcomp, with two for-clauses. It does "desugar" into a nested loop, but that doesn't make it a nested listcomp. -- nosy: +veky ___

[issue41591] Comprehensions documentation

2020-08-20 Thread Shubham Upreti
Shubham Upreti added the comment: Is this open? Can i take this up? -- nosy: +shubh07 ___ Python tracker ___ ___ Python-bugs-list m

[issue41591] Comprehensions documentation

2020-08-19 Thread Walid Taha
New submission from Walid Taha : The documentation for list comprehensions contains the following phrase: "As we saw in the previous section, the nested listcomp is evaluated in the context of the for that follows it, so this example is equivalent to:" This should be corrected, as it currentl