py2store.utils.cache_descriptors

descriptors to cache data

Functions

CachedProperty(*args)

CachedProperties.

Classes

Lazy(func[, name])

Lazy Attributes.

cachedIn(attribute_name)

Cached property with given cache attribute.

readproperty(func)

py2store.utils.cache_descriptors.CachedProperty(*args)[source]

CachedProperties. This is usable directly as a decorator when given names, or when not. Any of these patterns will work:

  • @CachedProperty

  • @CachedProperty()

  • @CachedProperty('n','n2')

  • def thing(self: …; thing = CachedProperty(thing)

  • def thing(self: …; thing = CachedProperty(thing, ‘n’)

class py2store.utils.cache_descriptors.Lazy(func, name=None)[source]

Bases: object

Lazy Attributes.

class py2store.utils.cache_descriptors.cachedIn(attribute_name)[source]

Bases: object

Cached property with given cache attribute.