A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2000-October/010147.html below:

[Python-Dev] sys.__stdout__ - was RE: [Idle-dev] Doc Commentary

[Python-Dev] sys.__stdout__ - was RE: [Idle-dev] Doc Commentary [Python-Dev] sys.__stdout__ - was RE: [Idle-dev] Doc CommentaryGordon McMillan gmcm@hypernet.com
Wed, 25 Oct 2000 20:39:14 -0400
> [Guido]
> 
> > Where did you get this idiom?  You should never use sys.__stdout__
> > this way!  The proper idiom is
> >
> >   save_stdout = sys.stdout
> >   try:
> >       sys.stdout = f
> >       # do some stuff
> >   finally:
> >       sys.stdout = save_stdout
[Mark]
> So what _is_ it intended for?

A fail-safe. The recommended idiom might also be called 
"plays well with others"; a barbarian notion that fortunately has 
not infected most import hacks or program exits...

works-for-me-so-buzz-off-ly y'rs

- Gordon



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4