Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-39534: Clarify return in finally #18324

Merged
merged 3 commits into from Feb 6, 2020
Merged

Conversation

JulienPalard
Copy link
Member

@JulienPalard JulienPalard commented Feb 3, 2020

I rewrapped the lines around my edit in another commit, to see just my wording change, select the first commit only.

https://bugs.python.org/issue39534

@csabella
Copy link
Contributor

csabella commented Feb 3, 2020

The new wording looks good. The only suggestion I would make is to remove the links from some of the keywords, like they are in the paragraph above this one. It may not be necessary to have every return be clickable, for example.

@JulienPalard
Copy link
Member Author

JulienPalard commented Feb 3, 2020

@csabella Removed a few links, good idea, too much blue don't help the readability (kept only one link per keyword on the whole list).

Copy link

@Pritesh-Inexture Pritesh-Inexture left a comment

If a finally clause includes a return statement, then always the expression after the return in finally will be returned. However, if try or except also has a return statement, in such a case the expression after that return statement will be evaluated but not returned. Also, the expression in try is always evaluated before the expression in finally.

I think this is how someone new to python can understand what will exactly happen in this case. @JulienPalard.

@JulienPalard
Copy link
Member Author

JulienPalard commented Feb 6, 2020

Looks a bit too heavy for me, we're in a tutorial, not in datamodel/.

@JulienPalard JulienPalard requested a review from csabella Feb 6, 2020
@csabella
Copy link
Contributor

csabella commented Feb 6, 2020

I agree with Julien. After reading this section of the tutorial, I think it's good that the bullet points highlight how the try/except/finally work together at a high level so that the reader can understand the general behavior, but I don't think it's necessary to go into it in more detail. Once the reader moves beyond the tutorial into the other docs, they will gain any deeper level of understanding when they need it.

@miss-islington
Copy link
Contributor

miss-islington commented Feb 6, 2020

Thanks @JulienPalard for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8.
🐍🍒🤖

@miss-islington
Copy link
Contributor

miss-islington commented Feb 6, 2020

I'm having trouble backporting to 3.8. Reason: 'Error 110 while writing to socket. Connection timed out.'. Please retry by removing and re-adding the needs backport to 3.8 label.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 6, 2020
(cherry picked from commit 446463f)

Co-authored-by: Julien Palard <julien@palard.fr>
@bedevere-bot
Copy link

bedevere-bot commented Feb 6, 2020

GH-18386 is a backport of this pull request to the 3.7 branch.

@miss-islington
Copy link
Contributor

miss-islington commented Feb 6, 2020

Thanks @JulienPalard for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒🤖

@miss-islington
Copy link
Contributor

miss-islington commented Feb 6, 2020

Thanks @JulienPalard for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 6, 2020
(cherry picked from commit 446463f)

Co-authored-by: Julien Palard <julien@palard.fr>
@bedevere-bot
Copy link

bedevere-bot commented Feb 6, 2020

GH-18387 is a backport of this pull request to the 3.8 branch.

sthagen added a commit to sthagen/python-cpython that referenced this pull request Feb 6, 2020
bpo-39534: Doc: Clarify return in finally (pythonGH-18324)
miss-islington added a commit that referenced this pull request Feb 6, 2020
(cherry picked from commit 446463f)

Co-authored-by: Julien Palard <julien@palard.fr>
miss-islington added a commit that referenced this pull request Feb 6, 2020
(cherry picked from commit 446463f)

Co-authored-by: Julien Palard <julien@palard.fr>
@JulienPalard JulienPalard deleted the return branch Oct 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir needs backport to 3.7 skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants