summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2002-09-11 18:20:34 (GMT)
committerGuido van Rossum <guido@python.org>2002-09-11 18:20:34 (GMT)
commit4061cbee9c2dd6fd6d186f525af8925a44f4d2fc (patch)
tree21af4b002bc36507f6cb34fd18eaaa54249a907c /Lib
parent806d1c817aad83c3381355d7d56a0ae2a427c1ff (diff)
downloadcpython-4061cbee9c2dd6fd6d186f525af8925a44f4d2fc.zip
cpython-4061cbee9c2dd6fd6d186f525af8925a44f4d2fc.tar.gz
cpython-4061cbee9c2dd6fd6d186f525af8925a44f4d2fc.tar.bz2
Patch suggested by Hamish Lawson: add an __iter__() that returns
iter(self.keys()).
Diffstat (limited to 'Lib')
-rwxr-xr-xLib/cgi.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/cgi.py b/Lib/cgi.py
index 5f4bad3..cf0146f 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