Gabriel Genellina gagsl-py2 at
Sat Jul 14 03:38:15 CEST 2007

En Fri, 13 Jul 2007 07:38:01 -0300, Tzury <Afro.Systems at>  

>> Which is a bug in the 'email.message' module, in my view. If it's
>> attempting to support a mapping protocol, it should allow iteration
>> the same way standard Python mappings do: by iterating over the keys.
> I thought it is a bug as well, but who am I a python newbie to say so.
> I found inspect.getmembers(msg) as a good solution to map the message
> properties.

Hmmm, I don't see why a message should support iteration, or even why  
iterating over a message should mean iterating over its headers... Anyway,  
if you want to iterate over all the message headers, the simplest way is  
using msg.keys()

Gabriel Genellina

More information about the Python-list mailing list