]> granicus.if.org Git - python/commit
bpo-10049: Add a "no-op" (null) context manager to contextlib (GH-4464)
authorJesse-Bakker <jessebakker00@gmail.com>
Thu, 23 Nov 2017 00:23:28 +0000 (01:23 +0100)
committerNick Coghlan <ncoghlan@gmail.com>
Thu, 23 Nov 2017 00:23:28 +0000 (10:23 +1000)
commit0784a2e5b174d2dbf7b144d480559e650c5cf64c
tree473d05eaf7ec712c9e6e023a0d43db3006a75981
parent20d48a44a54ed5e4a6df00e89ae27e3983128265
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.
Doc/library/contextlib.rst
Lib/contextlib.py
Lib/test/test_contextlib.py
Misc/NEWS.d/next/Library/2017-11-22-17-21-01.bpo-10049.ttsBqb.rst [new file with mode: 0644]