Skip to content

Commit 3272fe8

Browse files
committed
Update context_managers.rst
Grammatical errors: lines 103, 104, 107, 159, 161.
1 parent 0e65b48 commit 3272fe8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

context_managers.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ an error is encountered.
100100
2. It allows the ``__exit__`` method to handle the exception.
101101
3. If ``__exit__`` returns True then the exception was gracefully
102102
handled.
103-
4. If anything else than True is returned by ``__exit__`` method then
104-
the exception is raised by ``with`` statement.
103+
4. If anything else than True is returned by the ``__exit__`` method then
104+
an exception is raised by the ``with`` statement.
105105

106106
In our case the ``__exit__`` method returns ``None`` (when no return
107-
statement is encountered then the method returns ``None``). Therefore,
107+
statement is encountered then the method returns ``None``). Therefore, the
108108
``with`` statement raises the exception.
109109

110110
.. code:: python
@@ -156,9 +156,9 @@ Let's see a basic, useless example:
156156
yield f
157157
f.close()
158158
159-
Okay! This way of implementing Context Managers appear to be more
159+
Okay! This way of implementing Context Managers appears to be more
160160
intuitive and easy. However, this method requires some knowledge about
161-
generators, yield and decorators. In this example we have not caught any
161+
generators, yield, and decorators. In this example we have not caught any
162162
exceptions which might occur. It works in mostly the same way as the
163163
previous method.
164164

0 commit comments

Comments
 (0)