[Python-checkins] CVS: python/dist/src/Lib StringIO.py,1.17,1.18
Barry Warsaw
bwarsaw@users.sourceforge.net
Fri, 21 Sep 2001 21:34:56 -0700
Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv28518/Lib
Modified Files:
StringIO.py
Log Message:
__iter__(): New method so that StringIO's can participate in the
iterator protocol.
Index: StringIO.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/StringIO.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** StringIO.py 2001/02/09 13:37:37 1.17
--- StringIO.py 2001/09/22 04:34:54 1.18
***************
*** 46,49 ****
--- 46,52 ----
self.softspace = 0
+ def __iter__(self):
+ return iter(self.readline, '')
+
def close(self):
if not self.closed: