diff options
author | Guido van Rossum <guido@python.org> | 1997-01-11 19:21:33 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-01-11 19:21:33 (GMT) |
commit | 88b85d4f6331001951000ba4125af52573421b4a (patch) | |
tree | 58cfda2d3f3aaf47d303384ef8d49606ea06bdde /Lib/cgi.py | |
parent | afe3ebfa5ce97771b25122738c4153e3536fb8a0 (diff) | |
download | cpython-88b85d4f6331001951000ba4125af52573421b4a.zip cpython-88b85d4f6331001951000ba4125af52573421b4a.tar.gz cpython-88b85d4f6331001951000ba4125af52573421b4a.tar.bz2 |
Add __len__ method
Diffstat (limited to 'Lib/cgi.py')
-rwxr-xr-x | Lib/cgi.py | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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) |