diff options
author | Georg Brandl <georg@python.org> | 2009-03-31 19:10:35 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-03-31 19:10:35 (GMT) |
commit | b48adecbd68442708f74c57779c4bbce80fec7cd (patch) | |
tree | 2b32ffb61a5b09ff6cb5c451101de4e5d0455f88 /Doc | |
parent | 5206086e0dab4758b6ce77c86bf35138f3925997 (diff) | |
download | cpython-b48adecbd68442708f74c57779c4bbce80fec7cd.zip cpython-b48adecbd68442708f74c57779c4bbce80fec7cd.tar.gz cpython-b48adecbd68442708f74c57779c4bbce80fec7cd.tar.bz2 |
#1096310: document usage of sys.__std*__ a bit better.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/sys.rst | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index 30555c8..6d02109 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -871,9 +871,14 @@ always available. __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 |