[issue39037] Fix the trial order of the __exit__ and __enter__ methods in the with statement documentation

Nick Coghlan report at bugs.python.org
Sun Dec 15 07:23:33 EST 2019


Nick Coghlan <ncoghlan at gmail.com> added the comment:

It's a matter of historical timing: PEP 343 was written before try/except/finally was allowed, when try/finally and try/except were still distinct statements.

However, PEP 341 was *also* accepted and implemented for Python 2.5, allowing for the modern try/except/finally form: https://docs.python.org/dev/whatsnew/2.5.html#pep-341-unified-try-except-finally

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39037>
_______________________________________


More information about the Python-bugs-list mailing list