mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Bug #1030125: rfc822 __iter__ problem
Add iteration support to the Message class.
This commit is contained in:
parent
c6646c097a
commit
ce96d8b684
3 changed files with 15 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue