PEP 214 - Why not print >> string?

Aaron Swartz me at aaronsw.com
Fri Jan 11 11:12:38 EST 2002


On 2002-01-11 9:05 AM, in article a1muv5$ljn$1 at panix3.panix.com, "Aahz
Maruch" <aahz at panix.com> wrote:

> Why does using a [c]StringIO object feel kludgy?  After all, your
> proposal already requires x='' and using a "normal" file requires an
> open(), so what's wrong with x=StringIO()?

Well, at the time I wrote that I did not know about StringIO.getvalue(), so
that removes some concerns. However it still requires the extra import:

from cStringIO import StringIO

I guess it isn't so bad.
-- 
[ "Aaron Swartz" ; <mailto:me at aaronsw.com> ; <http://www.aaronsw.com/> ]




More information about the Python-list mailing list