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

Method setdefault

recipes/Python/578611_Bag_class/recipe-578611.py:153–155  ·  view source on GitHub ↗
(self, item, count=1)

Source from the content-addressed store, hash-verified

151 except KeyError: pass
152
153 def setdefault(self, item, count=1):
154 count = self._filter(count)
155 return count and dict.setdefault(self, item, count)
156
157 def itereach(self): #XXX consider rename akin to Python3 rules
158 """Will iterate through all items in bag individually.

Callers 5

__init__Method · 0.45
__get_stateMethod · 0.45
__set_namespaceMethod · 0.45
__set_parameterMethod · 0.45
__getitem__Method · 0.45

Calls 1

_filterMethod · 0.95

Tested by

no test coverage detected