From 4061cbee9c2dd6fd6d186f525af8925a44f4d2fc Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Wed, 11 Sep 2002 18:20:34 +0000 Subject: [PATCH] Patch suggested by Hamish Lawson: add an __iter__() that returns iter(self.keys()). --- Lib/cgi.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/cgi.py b/Lib/cgi.py index 5f4bad3c8b6..cf0146f4072 100755 --- a/Lib/cgi.py +++ b/Lib/cgi.py @@ -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