Author pitrou
Recipients barry, pitrou, r.david.murray, rhettinger, tim.peters
Date 2013-09-09.11:22:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1378725721.97.0.387646378602.issue18986@psf.upfronthosting.co.za>
In-reply-to
Content
This is a very common need when implementing network protocols. You want to match keys case-insensitively but also preserve the original casing (e.g. for presentation).

When searching on the Web, you see many people reimplementing their own variant (often incomplete, or buggy). For example, Twisted has its own, the email package has something resembling it, WebOb also.

Having an implementation in the stdlib would spare many people the effort, ensure the implementation is complete and well-tested, and perhaps also add some optimizations to mitigate the overhead compared to a plain dict.

Note this is an instance of a more general pattern, where they key used for matching is derived from the lookup key using a constant derivation function. So maybe we want to implement the more general pattern and let users specify str.lower as the key derivation function.
History
Date User Action Args
2013-09-09 11:22:02pitrousetrecipients: + pitrou, tim.peters, barry, rhettinger, r.david.murray
2013-09-09 11:22:01pitrousetmessageid: <1378725721.97.0.387646378602.issue18986@psf.upfronthosting.co.za>
2013-09-09 11:22:01pitroulinkissue18986 messages
2013-09-09 11:22:01pitroucreate