<div class="gmail_quote">On Wed, Nov 30, 2011 at 6:31 AM, Yuval Greenfield <span dir="ltr"><<a href="mailto:ubershmekel@gmail.com">ubershmekel@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div dir="ltr"><div class="gmail_quote">Since we marginally brushed the subject of backwards compatibility damning...</div><div class="gmail_quote"><br></div><div class="gmail_quote">I'm kind of surprised that files do that. Now that I check I'm surprised that StringIO does that.</div>


<div class="gmail_quote"><br></div><div class="gmail_quote">text = 'asdf\nword'</div><div class="gmail_quote">for item in StringIO(text):    !=    for item in text:</div><div class="gmail_quote"><br></div><div class="gmail_quote">


I'm not sure if I like that.</div></div></blockquote><div><br>We thought about that. Really. We concluded that while iterating over the characters of a file would be more "pure" but that it would rarely be useful, while iterating over the files would be incredibly useful. That was probably about 10 years ago, and I still think we made the right decision.<br>

<br></div></div>-- <br>--Guido van Rossum (<a href="http://python.org/~guido">python.org/~guido</a>)<br>