]> granicus.if.org Git - python/commitdiff
Patch suggested by Hamish Lawson: add an __iter__() that returns
authorGuido van Rossum <guido@python.org>
Wed, 11 Sep 2002 18:20:34 +0000 (18:20 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 11 Sep 2002 18:20:34 +0000 (18:20 +0000)
iter(self.keys()).

Lib/cgi.py

index 5f4bad3c8b6e126162c50bd72fad58774825ecba..cf0146f407274ee797cbd548daf8bbc404787420 100755 (executable)
@@ -525,6 +525,9 @@ class FieldStorage:
         return "FieldStorage(%s, %s, %s)" % (
                 `self.name`, `self.filename`, `self.value`)
 
+    def __iter__(self):
+        return iter(self.keys())
+
     def __getattr__(self, name):
         if name != 'value':
             raise AttributeError, name