[ python-Bugs-1096310 ] sys.__stdout__ doco isn't discouraging
enough
SourceForge.net
noreply at sourceforge.net
Sat Jan 8 23:41:20 CET 2005
Bugs item #1096310, was opened at 2005-01-05 04:18
Message generated for change (Comment added) made by kbk
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1096310&group_id=5470
Category: Documentation
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Just van Rossum (jvr)
Assigned to: Nobody/Anonymous (nobody)
Summary: sys.__stdout__ doco isn't discouraging enough
Initial Comment:
sys.__stdout__ is quite often abused (two independent sightings on
c.l.py yesterday): people use it to restore stdout instead of saving
the previous stdout.
The real intended use for __stdout__ isn't all that clear (I keep
wondering myself why it's there in the first place; its use case
must be quite obscure), but more importantly I think the sys docs
should contain a warning that __stdout__ is *not* suitable to
restore sys.stdout after redirection.
I'd produce a patch if I knew how to better describe what
sys.__stdout__ was *for*.
----------------------------------------------------------------------
>Comment By: Kurt B. Kaiser (kbk)
Date: 2005-01-08 17:41
Message:
Logged In: YES
user_id=149084
In IDLE it's useful for debugging:
print>>sys.__stderr__, "!!!BOO!!!"
will print a message to the console no matter what the
redirection status is. So that's a use in addition to the
two given in the sys module docs. Agreed that its bad
practice to use them to restore redirection, but that IMO
belongs in a tutorial, not the reference docs....
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1096310&group_id=5470
More information about the Python-bugs-list
mailing list