I believe the standard dictionary should be amened to allow the use of
case insensitive keys - as an option. I found some work done by others
to do that at:
but the problem with that approach is that they lowercase the keys
immediately when you create the dictionary and so the true identity of
the key is lost.
Of course, I can subclass it and save a copy of the "real" key but
that's kind of messcy.
In other words:
If I have:
pets=caselessDi ct()
pets["Cat"] = 3
pets["Dog"] = 2
I would like to see:
pets["cat"] prints 3
pets["DOG"] prints 2
but
print pets.keys()
should print:
"Cat", "Dog"
not:
"cat", "dog"
case insensitive keys - as an option. I found some work done by others
to do that at:
but the problem with that approach is that they lowercase the keys
immediately when you create the dictionary and so the true identity of
the key is lost.
Of course, I can subclass it and save a copy of the "real" key but
that's kind of messcy.
In other words:
If I have:
pets=caselessDi ct()
pets["Cat"] = 3
pets["Dog"] = 2
I would like to see:
pets["cat"] prints 3
pets["DOG"] prints 2
but
print pets.keys()
should print:
"Cat", "Dog"
not:
"cat", "dog"
Comment