PEP 214 - Why not print >> string?

Andrew Koenig ark at research.att.com
Thu Jan 10 14:08:48 EST 2002


Aaron> I'm not sure I see why. It would function similarly to += on strings.
Aaron>     print >> string, 'value'
Aaron> would be equivalent to:
Aaron>     string += 'value'
Aaron> (except you'd get the nice print formatting rules).

So
        x = ''
        print >> x, 3
        print >> x, 3

would cause x to be '3 3'?  Or would it be '3\n3\n' ?

What if I forgot to say  x = ''  first?


-- 
Andrew Koenig, ark at research.att.com, http://www.research.att.com/info/ark



More information about the Python-list mailing list