PEP 214 - Why not print >> string?
Aaron Swartz
me at aaronsw.com
Thu Jan 10 13:17:03 EST 2002
On 2002-10-01 11:16 AM, in article
M1k%7.10891$wd4.1322364 at atlpnn01.usenetserver.com, "Steve Holden"
<sholden at holdenweb.com> wrote:
> Unfortunately, this would seem to require that a variable name be bound to a
> string value in order to indicate that the result of the print statement
> should overwrite it. Then the prints are rebinding the named variable
> (obviously, since the string values are immutable). This seems a little
> bizarre.
I'm not sure I see why. It would function similarly to += on strings.
print >> string, 'value'
would be equivalent to:
string += 'value'
(except you'd get the nice print formatting rules).
> Why not Perl? ;-)
Zing!
(I must admit I don't like the >> symbol...)
--
[ "Aaron Swartz" ; <mailto:me at aaronsw.com> ; <http://www.aaronsw.com/> ]
More information about the Python-list
mailing list