[issue14167] document return statement in finally blocks

Yury Selivanov report at bugs.python.org
Thu Mar 1 16:07:09 CET 2012


New submission from Yury Selivanov <yselivanov at gmail.com>:

I think that the documentation should put more emphasis on the `return` statement in a `finally` block.

Example:

  def test():
      try:
          1/0
      finally:
          return 10

  >>> test()
  10

I think we need to add a warning, or at least a note, that 'return' masks exceptions, if any occurred.

----------
assignee: docs at python
components: Documentation
messages: 154697
nosy: Yury.Selivanov, docs at python, georg.brandl, rhettinger
priority: normal
severity: normal
status: open
title: document return statement in finally blocks
type: enhancement
versions: Python 2.7, Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14167>
_______________________________________


More information about the Python-bugs-list mailing list