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 martin.panter
Recipients adrien-saladin, barry, berker.peksag, kxroberto, martin.panter, python-dev, r.david.murray, rhettinger
Date 2016-06-13.00:09:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1465776580.57.0.456405221178.issue10839@psf.upfronthosting.co.za>
In-reply-to
Content
There are already the makings of an alternative API:

https://docs.python.org/3.6/library/email.message.html#email.message.Message.add_header

There is also replace_header(), but it only replaces the _first_ header field, and leaves later ones untouched. However there is only __del__(), which deletes all matching header fields; there is no remove_header() or similar.

I think I would support deprecating the __setitem__() etc methods, perhaps with a cleanup of the alternatives, e.g. add remove_all(). Also, __getitem__() is equivalent to get(), which does not raise KeyError. Although according to Issue 12111, David said things are unlikely to change.
History
Date User Action Args
2016-06-13 00:09:40martin.pantersetrecipients: + martin.panter, barry, rhettinger, kxroberto, r.david.murray, adrien-saladin, python-dev, berker.peksag
2016-06-13 00:09:40martin.pantersetmessageid: <1465776580.57.0.456405221178.issue10839@psf.upfronthosting.co.za>
2016-06-13 00:09:40martin.panterlinkissue10839 messages
2016-06-13 00:09:40martin.pantercreate