MCPcopy Create free account
hub / github.com/LabPy/lantz / _dget

Function _dget

lantz/action.py:26–34  ·  view source on GitHub ↗

Helper function to get an element by key from a dictionary defaulting to key=MISSING

(adict, instance=MISSING)

Source from the content-addressed store, hash-verified

24
25
26def _dget(adict, instance=MISSING):
27 """Helper function to get an element by key
28 from a dictionary defaulting to key=MISSING
29 """
30
31 try:
32 return adict[instance]
33 except KeyError:
34 return adict[MISSING]
35
36def _dset(adict, value, instance=MISSING):
37 """Helper function to set an element by key

Callers 4

pre_actionMethod · 0.70
rebuildMethod · 0.70
__getattr__Method · 0.70
__setattr__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected