New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use public classes for contextlib.suppress and redirect_stdout #63529
Comments
I broke help() for instances of these context managers by trying to postpone exposing the class APIs until 3.5 (and didn't even record my full rationale, however flawed, in the associated comments). The wrapper functions should be removed, making the classes the public implementation. I also plan to make the following changes (although I may end up moving them to separate issues):
|
I checked the other classes in contextlib to ensure they also provided decent docstrings on instances. They were mostly OK, but @contextmanager itself doesn't provide useful docs when inspecting the result context manager instances directly. However, fixing that isn't trivial: see bpo-19404 for details. |
New changeset 09153a9a3bb9 by Nick Coghlan in branch 'default': |
I suppose tests will fail when Python is compiled with --without-doc-strings options. Perhaps the test.support.requires_docstrings decorator should be used. |
It also fails under -OO, so I changed that decorator to deal with that case as well. |
New changeset a9bbc2d0c1dc by Nick Coghlan in branch 'default': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: