[New-bugs-announce] [issue19330] Use public classes for contextlib.suppress and redirect_stdout

Nick Coghlan report at bugs.python.org
Mon Oct 21 16:00:52 CEST 2013


New submission from Nick Coghlan:

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):

- provide (and document) a public "target" attribute on redirect_stdout
- make redirect_stdout reentrant (and switch to ExitStack as the reusable-but-not-reentrant example)

- provide (and document) a public "exceptions" attribute on suppress
- return self from suppress.__enter__

----------
assignee: ncoghlan
components: Library (Lib)
messages: 200782
nosy: larry, ncoghlan
priority: release blocker
severity: normal
stage: needs patch
status: open
title: Use public classes for contextlib.suppress and redirect_stdout
type: behavior
versions: Python 3.4

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


More information about the New-bugs-announce mailing list