summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xLib/cgi.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/cgi.py b/Lib/cgi.py
index 7fab38d..34a6c6d 100755
--- a/Lib/cgi.py
+++ b/Lib/cgi.py
@@ -890,6 +890,10 @@ class FieldStorage:
if item.name == key: return 1
return 0
+ def __len__(self):
+ """Dictionary style len(x) support."""
+ return len(self.keys())
+
def read_urlencoded(self):
"""Internal: read data in query string format."""
qs = self.fp.read(self.length)