[Idle-dev] Doc Commentary

Mats Wichmann mats@laplaza.org
Wed, 25 Oct 2000 07:59:56 -0600


Pardon a newbie's intrusion here... someone point me
to the right discussion place if this is no longer
current or is inappropriate.

In Re: Idle documentation - since Idle is now "standard"
in Python distribution kits, can Idle documentation also
become a "standard" part of the release?


In the 0.5 Idle docs - the latest I've come across -
there's a small section on limitations ("Shell Window" ->
"Special Issues").

Seems to me a mention might be made that the following
idiom also doesn't work as expected:

>>> import sys
>>> f = open('some-output-file', 'w')
>>> sys.stdout = f
>>> # do some stuff
>>> sys.stdout = sys.__stdout__

Because on entry, sys.stdout is already redirected
(not reflected in sys.__stdout__)

>>> sys.stdout
<PyShell.PseudoFile instance at 01128B1C>
>>> sys.__stdout__
<open file '<stdout>', mode 'w' at 00D328F0>

Gave me a moment's pause when I was writing up some
try-this-out examples - this is a difference from
the "normal" interpreter environment.  Easy enough
to work around if you know it's this way...

Cheers,

Mats Wichmann