Commit 70631490 authored by Fred Drake's avatar Fred Drake

Add some clarifications about the mapping interface presented by

rfc822.Message objects, based on comments from Barry.
parent b45032e6
...@@ -211,13 +211,15 @@ there is no header matching \var{name}, or it is unparsable, return ...@@ -211,13 +211,15 @@ there is no header matching \var{name}, or it is unparsable, return
\code{None}. \code{None}.
\end{methoddesc} \end{methoddesc}
\class{Message} instances also support a read-only mapping interface. \class{Message} instances also support a limited mapping interface.
In particular: \code{\var{m}[name]} is like In particular: \code{\var{m}[name]} is like
\code{\var{m}.getheader(name)} but raises \exception{KeyError} if \code{\var{m}.getheader(name)} but raises \exception{KeyError} if
there is no matching header; and \code{len(\var{m})}, there is no matching header; and \code{len(\var{m})},
\code{\var{m}.has_key(name)}, \code{\var{m}.keys()}, \code{\var{m}.has_key(name)}, \code{\var{m}.keys()},
\code{\var{m}.values()} and \code{\var{m}.items()} act as expected \code{\var{m}.values()} and \code{\var{m}.items()} act as expected
(and consistently). (and consistently). \class{Message} instances also support the
mapping writable interface \code{\var{m}[name] = value} and \code{del
\var{m}[name]}.
Finally, \class{Message} instances have two public instance variables: Finally, \class{Message} instances have two public instance variables:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment