This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author robla
Recipients AlexGrig, docs@python, ezio.melotti, rhettinger, robla, westley.martinez
Date 2014-08-04.03:57:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1407124664.55.0.95560924828.issue20402@psf.upfronthosting.co.za>
In-reply-to
Content
> Moving it earlier in the tutorial is likely to do more harm than help.
> In teaching Python, you need some gap between learning for-loops and 
> learning list comprehensions (the former is a prerequisite for the
> latter).

The problem here is that many people get list comprehensions foisted on them by reading code that has them in it.  Since list comprehensions aren't called "list comprehensions" in the code, but rather, they look like funny for loops, many people will turn to the for loop documentation, and as of this writing, they won't find anything.

There doesn't necessarily need to be the full example as in Alex's patch (though Alex's version seems fine to me), I think there should at least be some link to the list comprehension documentation, e.g. "It is also possible to prepend a function onto a 'for' loop.  This is a :ref:`list comprehensions <tut-listcomps>`, and is explained further in the next chapter."
History
Date User Action Args
2014-08-04 03:57:44roblasetrecipients: + robla, rhettinger, ezio.melotti, docs@python, westley.martinez, AlexGrig
2014-08-04 03:57:44roblasetmessageid: <1407124664.55.0.95560924828.issue20402@psf.upfronthosting.co.za>
2014-08-04 03:57:44roblalinkissue20402 messages
2014-08-04 03:57:44roblacreate