This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author brandon-rhodes
Recipients barry, brandon-rhodes, r.david.murray
Date 2014-03-29.01:26:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1396056379.22.0.363709068017.issue21091@psf.upfronthosting.co.za>
In-reply-to
Content
I love properties and think they should be everywhere. But consistency is more important, so I suspect that EmailMessage.is_attachment should be demoted to a normal method. Why? Because if it remains a property then I am likely to first write:

    if msg.is_attachment:
        ...

and then later, when doing another bit of email logic, write:

    if msg.is_multipart:
        ...

Unfortunately this second piece of code will give me no error and will appear to run just fine, because bool(a_method) always returns True without a problem or warning or error. But the result will not be what I expect: the if statement's true block will always run, regardless of whether the message is multipart.

Since EmailMessage is still provisional, and since no one can use is_attachment yet anyway because it is broken for nearly all attachments, mightn't we make these two features consistent before calling it official?
History
Date User Action Args
2014-03-29 01:26:19brandon-rhodessetrecipients: + brandon-rhodes, barry, r.david.murray
2014-03-29 01:26:19brandon-rhodessetmessageid: <1396056379.22.0.363709068017.issue21091@psf.upfronthosting.co.za>
2014-03-29 01:26:18brandon-rhodeslinkissue21091 messages
2014-03-29 01:26:17brandon-rhodescreate