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: Tutorial for Continue missing ... line
Type: Stage: resolved
Components: Documentation Versions: Python 3.10, Python 3.9, Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Chas Belov, DahlitzFlorian, docs@python, iritkatriel, miss-islington, orsenthil, rahul-kumi
Priority: normal Keywords: patch

Created on 2020-05-16 06:02 by Chas Belov, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 20334 closed Chas Belov, 2020-05-23 22:06
PR 26055 merged iritkatriel, 2021-05-12 09:45
PR 26057 merged miss-islington, 2021-05-12 10:23
PR 26058 merged miss-islington, 2021-05-12 10:23
Messages (13)
msg369014 - (view) Author: Chas Belov (Chas Belov) * Date: 2020-05-16 06:02
The tutorial code for Continue at https://docs.python.org/3.7/tutorial/controlflow.html#break-and-continue-statements-and-else-clauses-on-loops is missing a
...
null statement.

Actual code/result:

>>> for num in range(2, 10):
...     if num % 2 == 0:
...         print("Found an even number", num)
...         continue
...     print("Found a number", num)
Found an even number 2
Found a number 3
Found an even number 4
Found a number 5
Found an even number 6
Found a number 7
Found an even number 8
Found a number 9

Expected code/result:

>>> for num in range(2, 10):
...     if num % 2 == 0:
...         print("Found an even number", num)
...         continue
...     print("Found a number", num)
...
Found an even number 2
Found a number 3
Found an even number 4
Found a number 5
Found an even number 6
Found a number 7
Found an even number 8
Found a number 9
msg369570 - (view) Author: Rahul Kumaresan (rahul-kumi) * Date: 2020-05-22 08:49
I think the ommission of secondary prompt(...) at the end of the loop in the code snippet doesn't affect what the example wanted to demonstrate. Even so, if this has to be fixed, this correction is to be done in versions 3.5 through 3.10
msg369580 - (view) Author: Florian Dahlitz (DahlitzFlorian) * Date: 2020-05-22 09:47
@docorbit@sonic.net are you going to submit a PR for it or am I free to do it?
msg369687 - (view) Author: Chas Belov (Chas Belov) * Date: 2020-05-23 02:18
Um, Python newcomer here. What's a PR? Pull request?

I'm happy to do it if you can point me to the how-to. I know my way around git, and not around Python community standards. 

You are also welcome to go ahead and make the change; thank you for asking.
msg369692 - (view) Author: Florian Dahlitz (DahlitzFlorian) * Date: 2020-05-23 05:50
Please go head @docorbit@sonic.net! It's a good one to get familiar with the process of contributing. Yes, PR stands for Pull Request.

There is the devguide (https://devguide.python.org/), which documents how to contribute. In fact, the quick guide may be sufficient. Feel free to ask any further questions, I'm eager to help!
msg369704 - (view) Author: Chas Belov (Chas Belov) * Date: 2020-05-23 08:33
@DahlitzFlorian: I'm happy do to the PR provided I don't actually have to build Python to work on a documentation change. If it does require building Python then please go ahead.

That said, I've looked at the Doc/tutorial/controlflow.rst and it appears to be a plain text file. I believe that I would have a PR up by May 26, 2020. Is the best practice to check out the 3.10 branch then add backport tags for the other versions to the PR? That wasn't clear to me from the docs you referred me to.
msg369720 - (view) Author: Florian Dahlitz (DahlitzFlorian) * Date: 2020-05-23 14:17
I pointed you to the quick guide. In fact, you fork the cpython repository, create a new branch called fix-issue-40640, change the file Doc/tutorial/controlflow.rst and submit a PR agains the cpython master branch. As Rahul as already added all the versions to the issue that need a backport, the cpython bot will handle it for you. So you only need to submit a PR to the master branch. :)
msg369752 - (view) Author: Chas Belov (Chas Belov) * Date: 2020-05-23 22:10
@Florian Dahlitz, thank you for your help. I have created a PR at https://github.com/python/cpython/pull/20334 and it is awaiting approval of my CLA and of the change itself.
msg377981 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2020-10-04 22:34
ping
msg379152 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2020-10-20 18:41
Chas - there is a conflict in the PR. Would you mind refreshing it? I'll try to make sure it gets merged this time.
msg393500 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-05-12 10:25
New changeset 48cb11bf5b426bd3f1d010f987c03115661261b7 by Miss Islington (bot) in branch '3.10':
bpo-40640: doc -- add missing ... in example of Continue (GH-26055) (GH-26057)
https://github.com/python/cpython/commit/48cb11bf5b426bd3f1d010f987c03115661261b7
msg393502 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-05-12 10:28
New changeset ada9cdb94158a101db65af17b62cdd2ae6c3e782 by Miss Islington (bot) in branch '3.9':
bpo-40640: doc -- add missing ... in example of Continue (GH-26055) (GH-26058)
https://github.com/python/cpython/commit/ada9cdb94158a101db65af17b62cdd2ae6c3e782
msg393503 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-05-12 10:28
Thank you Chas!
History
Date User Action Args
2022-04-11 14:59:31adminsetgithub: 84820
2021-05-12 10:28:45iritkatrielsetstatus: open -> closed
resolution: fixed
messages: + msg393503

stage: patch review -> resolved
2021-05-12 10:28:13iritkatrielsetmessages: + msg393502
2021-05-12 10:25:58iritkatrielsetmessages: + msg393500
2021-05-12 10:23:16miss-islingtonsetpull_requests: + pull_request24698
2021-05-12 10:23:11miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request24697
2021-05-12 09:45:10iritkatrielsetpull_requests: + pull_request24695
2020-10-20 18:41:01iritkatrielsetmessages: + msg379152
2020-10-04 22:38:01iritkatrielsetnosy: + orsenthil
2020-10-04 22:34:17iritkatrielsetnosy: + iritkatriel

messages: + msg377981
versions: - Python 3.5, Python 3.6, Python 3.7
2020-05-23 22:10:56Chas Belovsetmessages: + msg369752
2020-05-23 22:06:27Chas Belovsetkeywords: + patch
stage: patch review
pull_requests: + pull_request19602
2020-05-23 14:17:00DahlitzFloriansetmessages: + msg369720
2020-05-23 08:33:11Chas Belovsetmessages: + msg369704
2020-05-23 05:50:36DahlitzFloriansetmessages: + msg369692
2020-05-23 02:18:35Chas Belovsetmessages: + msg369687
2020-05-22 09:47:55DahlitzFloriansetnosy: + DahlitzFlorian
messages: + msg369580
2020-05-22 08:49:36rahul-kumisetmessages: + msg369570
versions: + Python 3.5, Python 3.6, Python 3.8, Python 3.9, Python 3.10
2020-05-18 16:34:41rahul-kumisetnosy: + rahul-kumi
2020-05-16 06:02:21Chas Belovcreate