From 712bf45117cdfe69f364c5811e45a94ef75546f1 Mon Sep 17 00:00:00 2001 From: RightSexyOrc <86175513+RightSexyOrc@users.noreply.github.com> Date: Mon, 31 Oct 2022 18:58:02 +0000 Subject: [PATCH] Update PRETTY_GOOD_PRACTICES.md (#13763) --- PRETTY_GOOD_PRACTICES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PRETTY_GOOD_PRACTICES.md b/PRETTY_GOOD_PRACTICES.md index 92e1be6445..055123e5cf 100644 --- a/PRETTY_GOOD_PRACTICES.md +++ b/PRETTY_GOOD_PRACTICES.md @@ -46,7 +46,7 @@ This is useful for many forms of resource management and cleanup. - Deleting temporary files that are created - etc -One comon use of a context manager is to encapsulate a `try:` block in a reusable form. +One common use of a context manager is to encapsulate a `try:` block in a reusable form. The underlying dunder (double underscore) methods for a context manager are `.__enter__()` and `.__exit__()`. Usually it is more natural to use `@contextlib.contextmanager` to create a context manager from a generator function. Async context managers can be similarly created for use with the `async with` statement.