[issue15805] Add stdout redirection tool to contextlib

Nick Coghlan report at bugs.python.org
Mon Jul 22 01:05:59 CEST 2013


Nick Coghlan added the comment:

A good start, but:

1. io is too low level to depend on unittest (or even contextlib), as
anything it imports will be imported automatically at interpreter startup.
The context manager will need to be written out directly as a class with
the appropriate methods.

2. The name based API should accept the unqualified name and throw a value
error if an unexpected name is passed in.

3. The stdin replacement should have a separate optional keyword-only
"data" argument to request wrapping with StringIO, rather than duck typing
the replacement value.

----------

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


More information about the Python-bugs-list mailing list