[Python-checkins] r70867 - python/trunk/Doc/library/sys.rst

georg.brandl python-checkins at python.org
Tue Mar 31 21:10:36 CEST 2009


Author: georg.brandl
Date: Tue Mar 31 21:10:35 2009
New Revision: 70867

Log:
#1096310: document usage of sys.__std*__ a bit better.

Modified:
   python/trunk/Doc/library/sys.rst

Modified: python/trunk/Doc/library/sys.rst
==============================================================================
--- python/trunk/Doc/library/sys.rst	(original)
+++ python/trunk/Doc/library/sys.rst	Tue Mar 31 21:10:35 2009
@@ -871,9 +871,14 @@
           __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.
+   ``stdout`` at the start of the program.  They are used during finalization,
+   and could be useful to print to the actual standard stream no matter if the
+   ``sys.std*`` object has been redirected.
+
+   It can also be used to restore the actual files to known working file objects
+   in case they have been overwritten with a broken object.  However, the
+   preferred way to do this is to explicitly save the previous stream before
+   replacing it, and restore the saved object.
 
 
 .. data:: tracebacklimit


More information about the Python-checkins mailing list