[Tutor] The 'print >>' ogre

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Sun, 17 Feb 2002 03:22:13 -0800 (PST)


On Sun, 17 Feb 2002, Kalle Svensson wrote:

> [Danny Yoo]
> > In this case, we can use the 'print >>file' statement, and since you're
> > already familiar with how 'print' works, this should be a good way of
> > doing file output.
> 
> Arh, no!  Please don't let this monster escape to the daylight!

I suddenly have this image of this Grimm's Fairy Tales ogre, with a big
fat 'print >>' stamped on his chest, and he's prancing in my brain.  Oh
well, hopefully he'll disappear when I go to sleep.


> > operator, and seems to fix my internal model of Python. Has anyone written
> > a PEP request to change the syntax of 'print >>file' yet?)
> 
> I think such a PEP would be doomed, considering that there was a lot
> of syntax discussion when the >> PEP was written and that incompatible
> changes are frowned upon if they lack a technical motivation.

For reference, here's the PEP about the extended print statement:

    http://python.sourceforge.net/peps/pep-0214.html

I'm glancing through the PEP now, and none of the alternatives solutions
appear to do the same thing as a hypothetical 'fprint' statement.  
Perhaps I can learn how to write a PEP by proposing this.


I think it might be worth trying it.  How many people have used the
extended 'print >>' statement?  Perhaps a more important question: how
many people here have even heard about it?

If we're trying to limit its exposure to the light, we're definitely
making a judgement that it's either a terrible idea or smells terribly
bad.  I think it's the latter, and if that's the case, perhaps a strong
scrubbing is in order.  *grin*