Message instances compare as False

Bill Janssen <[email protected]>
Newsgroups gmane.comp.python.mime.devel
Message-ID <[email protected]>
I spent the morning finding and fixing a problem in my IMAP server,
which was caused by the fact that certain message instances evaluate as
"False", if they have no headers.  But that's a valid thing to have as
part of a multipart body, I believe.  So I had some code that looked
like this:

   foo = msg1 or msg2

and I was getting msg2 even though I thought I should be getting msg1.

Might make sense to explicitly bind __nonzero__ in this class.

Bill
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.