[issue10049] Add a "no-op" (null) context manager to contextlib (Rejected: use contextlib.ExitStack())

Nick Coghlan report at bugs.python.org
Fri Nov 18 22:17:48 EST 2016


Nick Coghlan added the comment:

The problem Martin is referring to is the SEO one, which is that the top link when searching for either "null context manager python" or "no-op context manager python" is this thread, rather than the "Use ExitStack for that" recipe in the docs: https://docs.python.org/3/library/contextlib.html#simplifying-support-for-single-optional-context-managers

We unfortunately have exactly zero SEO experts working on the CPython documentation, so even when we provide specific recipes in the docs for solving particular problems, they aren't always easy for people to find.

I've at least added the "use contextlib.ExitStack()" note to the issue title here, so folks can find that without having to read through the whole comment thread.

----------
title: Add a "no-op" (null) context manager to contextlib -> Add a "no-op" (null) context manager to contextlib (Rejected: use contextlib.ExitStack())

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10049>
_______________________________________


More information about the Python-bugs-list mailing list