A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2017-December/151481.html below:

[Python-Dev] 'continue'/'break'/'return' inside 'finally' clause

[Python-Dev] 'continue'/'break'/'return' inside 'finally' clause [Python-Dev] 'continue'/'break'/'return' inside 'finally' clauseSerhiy Storchaka storchaka at gmail.com
Thu Dec 28 13:36:35 EST 2017
28.12.17 16:38, Guido van Rossum пише:
> Looks to me the prohibition was to prevent a crash. It makes more sense 
> to fix it.

The crash can be fixed by just removing the check after finishing 
issue17611.

But is there any use case for 'continue'/'break'/'return' inside 
'finally' clause? The code like

     try:
         return 1
     finally:
         return 2

or

     try:
         continue
     finally:
         break

looks at least confusing. Currently 'break' and 'return' are never used 
inside 'finally' clause in the stdlib. I would want to see a third-party 
code that uses them.

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4