<div dir="ltr">It strikes me that there could be an alternative approach to some of the use cases discussed here. Instead of a new type of dictionary, the case-insensitivity problem could be solved with something akin to a <b>CaseInsensitiveString</b> class used for keys within a standard dictionary. This would be very similar to a normal string except with comparison and hashing. It would mean that CaseInsensitiveString("Foo") is considered equal to CaseInsensitiveString("foo") and allow code such as the following:<div>

<br></div><div>>>> headers = {}</div><div>>>> headers[CaseInsensitiveString("content-type")] = "text/plain"</div><div>>>> headers[CaseInsensitiveString("Content-Type")]</div>

<div>"text/plain"</div><div><br></div><div>This would obviously also be usable in other places where case-insensitive strings are required.</div><div><br></div><div>Just my two pence/cents/other minor currency units.</div>

<div>Nigel</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 30 October 2013 14:18, Ethan Furman <span dir="ltr"><<a href="mailto:ethan@stoneleaf.us" target="_blank">ethan@stoneleaf.us</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 10/30/2013 12:12 AM, Raymond Hettinger wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Hopefully, this post will make the thought process more transparent.<br>
</blockquote>
<br></div>
Thanks, Raymond.  Your time is appreciated.<br>
<br>
--<br>
~Ethan~<div class="HOEnZb"><div class="h5"><br>
______________________________<u></u>_________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org" target="_blank">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" target="_blank">https://mail.python.org/<u></u>mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/nigel%40nigelsmall.com" target="_blank">https://mail.python.org/<u></u>mailman/options/python-dev/<u></u>nigel%40nigelsmall.com</a><br>
</div></div></blockquote></div><br></div>