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

Method set_cache

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

Source from the content-addressed store, hash-verified

381 return self.value[instance].get(key, MISSING)
382
383 def set_cache(self, instance, value, key=MISSING):
384 old_value = self.get_cache(instance, key)
385
386 if value == old_value:
387 return
388
389 if key is MISSING:
390 assert isinstance(value, dict)
391 self.value[instance] = value
392 else:
393 self.value[instance][key] = value
394
395 getattr(instance, self.name + '_changed').emit(value, old_value, {'key': key})
396
397
398def _dochelper(feat):

Callers

nothing calls this directly

Calls 2

get_cacheMethod · 0.95
emitMethod · 0.45

Tested by

no test coverage detected