[issue20402] List comprehensions should be noted in for loop documentation

2014-08-03 Thread Rob Lanphier

Rob Lanphier added the comment:

> 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 
`, and is explained further in the next chapter."

--

___
Python tracker 
<http://bugs.python.org/issue20402>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20402] List comprehensions should be noted in for loop documentation

2014-01-26 Thread Rob Lanphier

New submission from Rob Lanphier:

The current list comprehension documentation is difficult to find for someone 
who doesn't know what a list comprehension is.  Example of this problem:
http://www.reddit.com/r/learnprogramming/comments/1w6slm/different_kind_of_for_loop_python/

Since list comprehensions are a riff off of "for" loop syntax, they should at 
least be noted and linked to from section 4.2 ("for statements" section) and 
quite possibly 5.6 ("Looping constructs")

--
assignee: docs@python
components: Documentation
messages: 209380
nosy: docs@python, robla
priority: normal
severity: normal
status: open
title: List comprehensions should be noted in for loop documentation
type: enhancement

___
Python tracker 
<http://bugs.python.org/issue20402>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com