Message197359
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. |
|
Date |
User |
Action |
Args |
2013-09-09 11:22:02 | pitrou | set | recipients:
+ pitrou, tim.peters, barry, rhettinger, r.david.murray |
2013-09-09 11:22:01 | pitrou | set | messageid: <1378725721.97.0.387646378602.issue18986@psf.upfronthosting.co.za> |
2013-09-09 11:22:01 | pitrou | link | issue18986 messages |
2013-09-09 11:22:01 | pitrou | create | |
|