MCPcopy Index your code
hub / github.com/LabPy/lantz / set_cache

Method set_cache

lantz/feat.py:302–313  ·  view source on GitHub ↗
(self, instance, value, key=MISSING)

Source from the content-addressed store, hash-verified

300 return MISSING
301
302 def set_cache(self, instance, value, key=MISSING):
303 old_value = self.get_cache(instance, key)
304
305 if value == old_value:
306 return
307
308 if isinstance(value, Q_):
309 value = copy.copy(value)
310
311 self.value[instance] = value
312
313 getattr(instance, self.name + '_changed').emit(value, old_value)
314
315
316class DictFeat(Feat):

Callers 2

getMethod · 0.95
setMethod · 0.95

Calls 2

get_cacheMethod · 0.95
emitMethod · 0.45

Tested by

no test coverage detected