There was an error while loading. Please reload this page.
1 parent e8aa372 commit 05551b4Copy full SHA for 05551b4
1 file changed
context_managers.rst
@@ -167,7 +167,7 @@ Let's dissect this method a little.
167
1. Python encounters the ``yield`` keyword. Due to this it creates a
168
generator instead of a normal function.
169
2. Due to the decoration, contextmanager is called with the function
170
- name (``open\_file``) as it's argument.
+ name (``open_file``) as it's argument.
171
3. The ``contextmanager`` decorator returns the generator wrapped by the
172
``GeneratorContextManager`` object.
173
4. The ``GeneratorContextManager`` is assigned to the ``open_file``
@@ -180,4 +180,4 @@ Manager like this:
180
.. code:: python
181
182
with open_file('some_file') as f:
183
- f.write('hola!')
+ f.write('hola!')
0 commit comments