Skip to content

Commit 43bf814

Browse files
author
schubisu
committed
minor suggestions for context manager section in classes
1 parent f1d4212 commit 43bf814

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
@@ -527,13 +527,13 @@ Creating a new context manager
527527

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

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

539539
::
@@ -566,7 +566,7 @@ Output in the `tmpdata.txt` file.
566566
Entering at 1590551277.323565
567567
Done at 1590551277.3238761
568568

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

571571
Deep down inside
572572
=================

0 commit comments

Comments
 (0)