summaryrefslogtreecommitdiffstats
path: root/Lib/rfc822.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-09-22 17:17:32 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-09-22 17:17:32 (GMT)
commitce96d8b6846f5658018923efcb8a5810bbb0bfb7 (patch)
treea3aa2a928e6ece056cd4c4c2ba897767e7257f64 /Lib/rfc822.py
parentc6646c097aceec4b4ee64968e875b508e908e9f4 (diff)
downloadcpython-ce96d8b6846f5658018923efcb8a5810bbb0bfb7.zip
cpython-ce96d8b6846f5658018923efcb8a5810bbb0bfb7.tar.gz
cpython-ce96d8b6846f5658018923efcb8a5810bbb0bfb7.tar.bz2
Bug #1030125: rfc822 __iter__ problem
Add iteration support to the Message class.
Diffstat (limited to 'Lib/rfc822.py')
-rw-r--r--Lib/rfc822.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/rfc822.py b/Lib/rfc822.py
index 3b4246d..18277d6 100644
--- a/Lib/rfc822.py
+++ b/Lib/rfc822.py
@@ -444,6 +444,9 @@ class Message:
"""Determine whether a message contains the named header."""
return name.lower() in self.dict
+ def __iter__(self):
+ return iter(self.dict)
+
def keys(self):
"""Get all of a message's header field names."""
return self.dict.keys()