mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
bpo-10049: Add a "no-op" (null) context manager to contextlib (GH-4464)
Adds a simpler and faster alternative to ExitStack for handling single optional context managers without having to change the lexical structure of your code.
This commit is contained in:
parent
20d48a44a5
commit
0784a2e5b1
4 changed files with 57 additions and 19 deletions
|
@ -0,0 +1,3 @@
|
|||
Added *nullcontext* no-op context manager to contextlib. This provides a
|
||||
simpler and faster alternative to ExitStack() when handling optional context
|
||||
managers.
|
Loading…
Add table
Add a link
Reference in a new issue