MCPcopy Create free account
hub / github.com/ActiveState/code / get

Method get

recipes/Python/496842_Sized_Dictionary/recipe-496842.py:19–28  ·  view source on GitHub ↗
(self, name, default=None, do_set=False)

Source from the content-addressed store, hash-verified

17
18 # Recommended but not required:
19 def get(self, name, default=None, do_set=False):
20 try:
21 return self.__getitem__(name)
22 except KeyError:
23 if default is not None:
24 if do_set:
25 self.__setitem__(name, default)
26 return default
27 else:
28 raise
29
30class CacheDict(dict):
31 ''' A sized dictionary with a timeout (seconds) '''

Callers 7

__getattr__Method · 0.45
getExitPointsMethod · 0.45
retracePathMethod · 0.45
endlessLoopMethod · 0.45
mainFunction · 0.45
agroupbyFunction · 0.45
processorMethod · 0.45

Calls 2

__setitem__Method · 0.95
__getitem__Method · 0.45

Tested by

no test coverage detected