Home | Trees | Indices | Help |
|
---|
|
object --+ | dict --+ | CaseSemisensitiveDict
A dictionary allowing case-insensitive access to its content.
This is used for DAL renderers which, unfortunately, are supposed to be case insensitive. Since case insensitivity is at least undesirable for service-specific keys, we go a semi-insenstitve approach here: First, we try literal matches, if that does not work, we try matching against an all-uppercase version.
Name clashes resulting from different names being mapped to the same normalized version are handled in some random way. Don't do this. And don't rely on case normalization if at all possible.
Only strings are allowed as keys here. This class is not concerned with the values. >>> d = CaseSemisensitiveDict({"a": 1, "A": 2, "b": 3}) >>> d["a"], d["A"], d["b"], d["B"] (1, 2, 3, 3) >>> d["B"] = 9; d["b"], d["B"] (3, 9) >>> del d["b"]; d["b"], d["B"] (9, 9) >>> "B" in d, "b" in d, "u" in d (True, True, False)
Instance Methods | |||
new empty dictionary |
|
||
|
|||
|
|||
True if D has a key k, else False |
|
||
D[k] if k in D, else d |
|
||
Inherited from Inherited from |
Class Variables | |
Inherited from |
Properties | |
Inherited from |
Method Details |
x.__init__(...) initializes x; see help(type(x)) for signature
|
x[y]
|
x[i]=y
|
|
d defaults to None.
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu May 2 07:29:09 2019 | http://epydoc.sourceforge.net |