[Python-checkins] CVS: python/dist/src/Lib mailbox.py,1.30,1.31
Fred L. Drake
fdrake@users.sourceforge.net
Wed, 02 May 2001 13:20:55 -0700
Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv30365
Modified Files:
mailbox.py
Log Message:
Make the Mailbox objects support iteration -- they already had the
appropriate next() method, and this is what people really want to do with
these objects in practice.
Index: mailbox.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/mailbox.py,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -r1.30 -r1.31
*** mailbox.py 2001/04/15 13:32:27 1.30
--- mailbox.py 2001/05/02 20:20:53 1.31
***************
*** 15,18 ****
--- 15,21 ----
self.factory = factory
+ def __iter__(self):
+ return self
+
def next(self):
while 1:
***************
*** 192,195 ****
--- 195,201 ----
self.factory = factory
+ def __iter__(self):
+ return self
+
def next(self):
if not self.boxes:
***************
*** 219,222 ****
--- 225,231 ----
self.boxes = boxes
+
+ def __iter__(self):
+ return self
def next(self):