colour.utilities.CaseInsensitiveMapping¶
-
class
colour.utilities.
CaseInsensitiveMapping
(data=None, **kwargs)[source]¶ Bases:
collections.abc.MutableMapping
Implements a case-insensitive mutable mapping / dict object.
Allows values retrieving from keys while ignoring the key case. The keys are expected to be unicode or string-like objects supporting the
str.lower()
method.- Parameters
data (dict) – dict of data to store into the mapping at initialisation.
- Other Parameters
**kwargs (dict, optional) – Key / Value pairs to store into the mapping at initialisation.
-
__repr__
()¶
Warning
The keys are expected to be unicode or string-like objects.
References
Examples
>>> methods = CaseInsensitiveMapping({'McCamy': 1, 'Hernandez': 2}) >>> methods['mccamy'] 1
-
copy
()[source] Returns a copy of the mapping.
- Returns
Mapping copy.
- Return type
Notes
The
colour.utilities.CaseInsensitiveMapping
class copy returned is a simple copy not a deepcopy.
-
property
data
¶ Getter and setter property for the data.
-
lower_items
()[source] Iterates over the lower items names.
- Returns
Lower item names.
- Return type
generator