Case insensitive dictionary?

Pierre-Frédéric Caillaud peufeu at
Fri Jun 25 20:04:53 CEST 2004

	Be careful about what character encoding and locale you use, as lower()  
won't process accented characters correctly if the encoding is wrong.

On 25 Jun 2004 10:21:21 -0700, Elbert Lev <elbertlev at> wrote:

> Hi!
> Here is the problem:
> I have a dictionary. Keys are strings. How to make dictionary  lookup
> case insensitive?
> In other words:
> If dict = {'First":"Bob", "Last":"Tom"}, dict["first"] should return
> "Bob"
> Maybe dictionary is not the right data type? If so what is?

Using Opera's revolutionary e-mail client:

More information about the Python-list mailing list