colour.utilities.CACHE_REGISTRY

colour.utilities.CACHE_REGISTRY = <colour.utilities.common.CacheRegistry object>

A registry for mapping-based caches.

Attributes

Methods

Examples

>>> cache_registry = CacheRegistry()
>>> cache_a = cache_registry.register_cache('Cache A')
>>> cache_a['Foo'] = 'Bar'
>>> cache_b = cache_registry.register_cache('Cache B')
>>> cache_b['John'] = 'Doe'
>>> cache_b['Luke'] = 'Skywalker'
>>> print(cache_registry)
{'Cache A': '1 item(s)', 'Cache B': '2 item(s)'}
>>> cache_registry.clear_cache('Cache A')
>>> print(cache_registry)
{'Cache A': '0 item(s)', 'Cache B': '2 item(s)'}
>>> cache_registry.unregister_cache('Cache B')
>>> print(cache_registry)
{'Cache A': '0 item(s)'}
>>> print(cache_b)
{}