I was never involved in discussions, so that the topics i address may have been defined for EMAIL 6 already etc., but because i've not found anything in the archives of the list back in 2010 i add yet another feature request which really worries me.
I find the interface a bit inconsistent in respect to replace_header() (replaces the first header found), __delitem__() (drops them all), __setitem__() (appends) in any case. (I personally would through these __accessor__ things away, they taste a bit strange when used to access email payload.) And i would provide a series of functions which can be used to get/set/modify header fields and bodies: i would check wether the argument is a list and if, it would mean "all bodies of a field". This is of course very hard to implement if it's done gracefully, i.e. with modification-detection, order-preservation etc. Another, easier to implement, idea would be (yet) an(other) iterator which supports in-place editing. Perfect: it could yield a (to be invented) class which offers methods like .field(), .bodies() (all [bodies] - maybe even as sub-iterator), .remove_field() etc... Doing it like this would offer the possibility to easily detect in-place editing of header bodies etc... All of these are just suggestions and my very personal point of view, of course. But one thing is true, and that's that it is currently really hard to remove or replace just one body of a field, especially if there are multiple bodies for a field. -- Steffen Daode _______________________________________________ Email-SIG mailing list Email-SIG@python.org Your options: http://mail.python.org/mailman/options/email-sig/archive%40mail-archive.com