[New-bugs-announce] [issue39534] Clarify tutorial on return statement in finally clause.

Julien Palard report at bugs.python.org
Mon Feb 3 03:21:12 EST 2020

New submission from Julien Palard <julien+python at palard.fr>:

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

assignee: mdk
components: Documentation
messages: 361269
nosy: mdk
priority: normal
severity: normal
status: open
title: Clarify tutorial on return statement in finally clause.
type: enhancement
versions: Python 3.7, Python 3.8, Python 3.9

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list