[Python-Dev] 'continue'/'break'/'return' inside 'finally' clause (original) (raw)

Guido van Rossum guido at python.org
Wed Jan 3 17:15:26 EST 2018


I'm sorry, I don't think more research can convince me either way. I want all three of return/break/continue to work inside finally clauses, despite there being few use cases.

On Wed, Jan 3, 2018 at 2:30 PM, Neil Schemenauer <nas-python at arctrix.com> wrote:

On 2018-01-03, Serhiy Storchaka wrote: > I haven't found 'finally' clauses in > https://github.com/gevent/gevent/blob/master/src/gevent/ libev/corecffi.py. > Perhaps this code was changed in recent versions.

Yes, I was looking at was git revision bcf4f65e. I reran my AST checker and found this: ./src/gevent/ffi/loop.py: 181: return inside finally > In any case we now know that this combination is occurred (but > very rarely) in the wild. Looks like it. If we do want to seriously consider changing the grammar, I will download more packages of PyPI and check them. BTW, ./src/gevent/threadpool.py doesn't compile with 3.7 because it uses 'async' as a variable name. So either they didn't notice the deprecation warnings or they didn't care to update their code. Regards, Neil


Python-Dev mailing list Python-Dev at python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/ guido%40python.org

-- --Guido van Rossum (python.org/~guido) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20180103/9b0e4c44/attachment.html>



More information about the Python-Dev mailing list