Skip to content

Commit 28f27a4

Browse files
committed
Fix wrong trial order of __exit__ and __enter__ in the with statement
1 parent 0fd6b3e commit 28f27a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/reference/compound_stmts.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,10 +399,10 @@ The execution of the :keyword:`with` statement with one "item" proceeds as follo
399399
#. The context expression (the expression given in the :token:`with_item`) is
400400
evaluated to obtain a context manager.
401401

402-
#. The context manager's :meth:`__exit__` is loaded for later use.
403-
404402
#. The context manager's :meth:`__enter__` method is invoked.
405403

404+
#. The context manager's :meth:`__exit__` is loaded for later use.
405+
406406
#. If a target was included in the :keyword:`with` statement, the return value
407407
from :meth:`__enter__` is assigned to it.
408408

0 commit comments

Comments
 (0)