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.

classification
Title: Missing line in example program
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.6
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, lucbouge, r.david.murray
Priority: normal Keywords:

Created on 2017-07-16 18:24 by lucbouge, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg298445 - (view) Author: Luc Bougé (lucbouge) Date: 2017-07-16 18:24
On page <https://docs.python.org/3.6/_sources/library/stdtypes.txt>, the following program is listed.

It raises a syntactic error.

An empty line is missing after "...     n += val" to close the loop body. 

   >>> # iteration
   >>> n = 0
   >>> for val in values:
   ...     n += val
   >>> print(n)
   504
msg298447 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2017-07-16 19:33
This is the standard way that we write examples.  Sprinkling in extra blank lines everywhere would make the examples less readable.  One you've learned how the command interpreter works, the examples are clear, so you each beginner only has to learn this once (and I believe it is explained in the tutorial, though I haven't checked).
History
Date User Action Args
2022-04-11 14:58:49adminsetgithub: 75124
2017-07-16 19:33:16r.david.murraysetstatus: open -> closed

type: resource usage -> behavior

nosy: + r.david.murray
messages: + msg298447
resolution: not a bug
stage: resolved
2017-07-16 18:24:33lucbougecreate