Commit c2073714 authored by Barry Warsaw's avatar Barry Warsaw

__iter__(): New method so that StringIO's can participate in the

iterator protocol.
parent 3a4ba81d
......@@ -45,6 +45,9 @@ class StringIO:
self.closed = 0
self.softspace = 0
def __iter__(self):
return iter(self.readline, '')
def close(self):
if not self.closed:
self.closed = 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment