[Python-Dev] extended print statement, uPre-PEP

Moshe Zadka Moshe Zadka <moshez@math.huji.ac.il>
Sat, 22 Jul 2000 09:49:57 +0300 (IDT)


On Sat, 22 Jul 2000, Barry A. Warsaw wrote:

> I've long wanted to make the print statement able to handle
> alternative output files in a more convenient syntax.  Yes you can
> rebind sys.stdout, but that is often very clumsy to get right in the
> face of exceptions.

Then why not go the other way, and get sys.stdout-rebinding easier to get
right?

something like

sys.push_stdout(fileobj)
try:
	print and stuff
finally:
	sys.pop_stdout()

> Thoughts?

Ummm...between this and Hyauiu's proposal, I'm afraid we're bloating
Python way too much.
--
Moshe Zadka <moshez@math.huji.ac.il>
There is no GOD but Python, and HTTP is its prophet.
http://advogato.org/person/moshez