[New-bugs-announce] [issue29390] Python Tutorial should introduce iterators and generators

Michael Kesper report at bugs.python.org
Mon Jan 30 05:05:09 EST 2017

New submission from Michael Kesper:

Please look at http://stackoverflow.com/questions/41932287/how-can-i-create-a-loop-for-these-if-statements/41932494?noredirect=1#41932494 

For beginners, it would be good to introduce the concepts of 'pythonic' dealing with sequences (iterators) and streams (generators) as soon as possible and everywhere where sequenceable data structures are discussed.

It is a common idiom in other languages to access members of sequences with counters, risking off-by-one errors or IndexErrors.

If beginners aren't introduced to the 'right' concepts soon enough, they might have a hard time figuring out the 'iterator' way.
Iterators should at least be mentioned in https://docs.python.org/3/tutorial/datastructures.html#looping-techniques.

assignee: docs at python
components: Documentation
messages: 286480
nosy: docs at python, mkesper
priority: normal
severity: normal
status: open
title: Python Tutorial should introduce iterators and generators
type: enhancement

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list