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: Clarify tutorial on return statement in finally clause.
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.9, Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: mdk Nosy List: BTaskaya, mdk, miss-islington
Priority: normal Keywords: patch

Created on 2020-02-03 08:21 by mdk, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 18324 merged mdk, 2020-02-03 08:23
PR 18386 merged miss-islington, 2020-02-06 22:17
PR 18387 merged miss-islington, 2020-02-06 22:17
Messages (4)
msg361269 - (view) Author: Julien Palard (mdk) * (Python committer) Date: 2020-02-03 08:21
According to [1][2] the documentation about return in finally statement is missleading in [3].

It currently states:

> If a finally clause includes a return statement, the finally clause’s return statement will execute before, and instead of, the return statement in a try clause.

I would prefer speaking about returned values instead of statements executed, I think it would clarify the point.


[1]: https://mail.python.org/archives/list/docs@python.org/message/LBMO47JSDPKFKLYR25HAKD7A76D5IHWI/
[2]: https://stackoverflow.com/questions/59639733/python-docs-have-misleading-explanation-of-return-in-finally
[3]: https://docs.python.org/3.7/tutorial/errors.html#defining-clean-up-actions
msg361508 - (view) Author: Julien Palard (mdk) * (Python committer) Date: 2020-02-06 22:16
New changeset 446463f8dbce0556be8020914f37089b63bb8ab6 by Julien Palard in branch 'master':
bpo-39534: Doc: Clarify return in finally (GH-18324)
https://github.com/python/cpython/commit/446463f8dbce0556be8020914f37089b63bb8ab6
msg361510 - (view) Author: miss-islington (miss-islington) Date: 2020-02-06 22:22
New changeset 83efed9eba9e50ed2395bd3366c31628b9555b1e by Miss Islington (bot) in branch '3.7':
bpo-39534: Doc: Clarify return in finally (GH-18324)
https://github.com/python/cpython/commit/83efed9eba9e50ed2395bd3366c31628b9555b1e
msg361511 - (view) Author: miss-islington (miss-islington) Date: 2020-02-06 22:23
New changeset 97e00b3c52796cb54dd0a50548760579b9cb7b3a by Miss Islington (bot) in branch '3.8':
bpo-39534: Doc: Clarify return in finally (GH-18324)
https://github.com/python/cpython/commit/97e00b3c52796cb54dd0a50548760579b9cb7b3a
History
Date User Action Args
2022-04-11 14:59:26adminsetgithub: 83715
2020-02-10 10:15:24mdksetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-02-06 22:23:11miss-islingtonsetmessages: + msg361511
2020-02-06 22:22:19miss-islingtonsetnosy: + miss-islington
messages: + msg361510
2020-02-06 22:17:23miss-islingtonsetpull_requests: + pull_request17761
2020-02-06 22:17:04miss-islingtonsetpull_requests: + pull_request17760
2020-02-06 22:16:55mdksetmessages: + msg361508
2020-02-03 08:23:07mdksetkeywords: + patch
stage: patch review
pull_requests: + pull_request17697
2020-02-03 08:22:08vstinnersetnosy: + BTaskaya
2020-02-03 08:21:12mdkcreate