Message instances compare as False

View: New views
1 Messages — Rating Filter:   Alert me  

Message instances compare as False

by jalopyuser :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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
_______________________________________________
Email-SIG mailing list
Email-SIG@...
Your options: http://mail.python.org/mailman/options/email-sig/lists%40nabble.com