[issue29414] Change 'the for statement is such an iterator' in Tutorial
Wolfgang Maier
report at bugs.python.org
Tue Feb 28 11:18:17 EST 2017
Wolfgang Maier added the comment:
I studied the github PR and thought about it carefully, and that made me come to believe that the chapter deserves a larger rewrite not just of one section, but of several.
I'm attaching my proposed change as a "classical" patch here for discussion. I hope that's still a valid way to do this as I did not want to mess with the original PR by Marco and, instead, wanted to see my proposal discussed first.
Some of the changes I made:
- I don't think range() really deserves its own section in a chapter about control flow, so I removed most of it and linked to the relevant stdtypes section instead
- moved the definition of an iterable up into the for loop section
- restructured the for loop section to discuss Python for loops first and only compare them to Pascal/C afterwards
- moved the example for modifying a list while iterating over it to the datastructures chapter
I find this new version much clearer, but lets see what people here think.
----------
nosy: +wolma
Added file: http://bugs.python.org/file46681/controlflow_datastructures.patch
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29414>
_______________________________________
More information about the Python-bugs-list
mailing list