mirror of https://github.com/python/cpython
bpo-32822: Add finally with return/break/continue to the tutorial (#25600)
This documents in the tutorial docs the behavior of a finally clause in case it should re-raise an exception but contains a return/break/continue statement.
This commit is contained in:
parent
33d9bf298b
commit
a0b9915a8b
|
@ -405,6 +405,10 @@ points discuss more complex cases when an exception occurs:
|
|||
or :keyword:`!else` clause. Again, the exception is re-raised after
|
||||
the :keyword:`!finally` clause has been executed.
|
||||
|
||||
* If the :keyword:`!finally` clause executes a :keyword:`break`,
|
||||
:keyword:`continue` or :keyword:`return` statement, exceptions are not
|
||||
re-raised.
|
||||
|
||||
* If the :keyword:`!try` statement reaches a :keyword:`break`,
|
||||
:keyword:`continue` or :keyword:`return` statement, the
|
||||
:keyword:`!finally` clause will execute just prior to the
|
||||
|
|
Loading…
Reference in New Issue