Daniel Diniz <aja...@gmail.com> added the comment:

Current docs seem to explain what __stdout__ is for:
"""
__stdin__ / __stdout__ / __stderr__

These objects contain the original values of stdin, stderr and stdout at
the start of the program. They are used during finalization, and could
be useful to restore the actual files to known working file objects in
case they have been overwritten with a broken object.
"""

Should a note of warning be added? Something like:

Explicitly saving the original IO streams and restoring them after
redirection is safer and the recommended idiom.

----------
nosy: +ajaksu2
versions: +Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue1096310>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to