mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-09-11 18:58:59 +03:00
Update PRETTY_GOOD_PRACTICES.md (#13763)
This commit is contained in:
parent
008ef2acd4
commit
712bf45117
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user