PEP 214 - Why not print >> string?

Aahz Maruch aahz at panix.com
Fri Jan 11 10:05:09 EST 2002


[p&e per poster's request, but do *not* cc me in e-mail]

In article <B8631E26.17D53%me at aaronsw.com>,
Aaron Swartz  <me at aaronsw.com> wrote:
>
>It seems to me that this and other similar functions would be more
>appropriate returning strings, so that their values can be used in other
>ways and combined into expressions like len(tables(1)). (Yet still easily
>written to a file as: "print >> file, tables(val)".) Of course, one can
>always use a StringIO object, but this feels rather kludgey.

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()?
-- 
                      --- Aahz  <*>  (Copyright 2002 by aahz at pobox.com)

Hugs and backrubs -- I break Rule 6                 http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista   

"There are times when effort is important and necessary, but this should
not be taken as any kind of moral imperative."  --jdecker



More information about the Python-list mailing list