Skip to content

Commit d4c028d

Browse files
authored
Merge pull request #146 from Schubisu/typos_context_manager
minor suggestions for context manager section in classes
2 parents 43d5949 + 43bf814 commit d4c028d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/classes.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -528,13 +528,13 @@ Creating a new context manager
528528

529529
Do you remember the `with` statement from the `files` chapter? Where we used a
530530
context manager to make sure that the file is closed after we are done? The
531-
same style is used in many places where we can the resources to be cleaned
532-
after the work, sometimes we want to call some extra functions when we are
531+
same style is used in many places where we want the resources to be cleaned up
532+
after the work is done; sometimes we want to call some extra functions when we are
533533
done. We can write our own context manager in our classs using `__enter__` and
534534
`__exit__` methods.
535535

536536
For example, we will create a new class called `TimeLog` which in turn will
537-
create a file called `tmpdata.txt` in the current directory and logs the time
537+
create a file called `tmpdata.txt` in the current directory to log the time
538538
this context manager is created and when it is done.
539539

540540
::
@@ -567,7 +567,7 @@ Output in the `tmpdata.txt` file.
567567
Entering at 1590551277.323565
568568
Done at 1590551277.3238761
569569

570-
Later in the book we will learn even simpler method to create context managers.
570+
Later in the book we will learn even simpler methods to create context managers.
571571

572572
Deep down inside
573573
=================

0 commit comments

Comments
 (0)