All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
2018e66)
Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
# -- General configuration ---------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
# -- General configuration ---------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
Although when the target version is Python 3.9 or higher, _Black_ will use parentheses
instead since they're allowed in Python 3.9 and higher.
Although when the target version is Python 3.9 or higher, _Black_ will use parentheses
instead since they're allowed in Python 3.9 and higher.
+An alternative to consider if the backslashes in the above formatting are undesirable is
+to use {external:py:obj}`contextlib.ExitStack` to combine context managers in the
+following way:
+
+```python
+with contextlib.ExitStack() as exit_stack:
+ cm1 = exit_stack.enter_context(make_context_manager(1))
+ cm2 = exit_stack.enter_context(make_context_manager(2))
+ cm3 = exit_stack.enter_context(make_context_manager(3))
+ cm4 = exit_stack.enter_context(make_context_manager(4))
+ ...
+```
+
## Preview style
Experimental, potentially disruptive style changes are gathered under the `--preview`
## Preview style
Experimental, potentially disruptive style changes are gathered under the `--preview`