1
2
3 """
4 A simple implementation of a key case-insensitive dictionary.
5
6 @authors: U{Ivan Herman<http://www.ivan-herman.net>}, U{Sergio Fernández<http://www.wikier.org>}, U{Carlos Tejo Alonso<http://www.dayures.net>}
7 @organization: U{World Wide Web Consortium<http://www.w3.org>} and U{Foundation CTIC<http://www.fundacionctic.org/>}.
8 @license: U{W3C® SOFTWARE NOTICE AND LICENSE<href="http://www.w3.org/Consortium/Legal/copyright-software">}
9 """
10
12 """
13 A simple implementation of a key case-insensitive dictionary
14 """
15
17 for k, v in d.items():
18 self[k] = v
19
21 if hasattr(key, "lower"):
22 key = key.lower()
23 dict.__setitem__(self, key, value)
24
26 if hasattr(key, "lower"):
27 key = key.lower()
28 return dict.__getitem__(self, key)
29
31 if hasattr(key, "lower"):
32 key = key.lower()
33 dict.__delitem__(self, key)
34