MCPcopy
hub / github.com/django/django / setdefault

Method setdefault

django/utils/datastructures.py:159–164  ·  view source on GitHub ↗
(self, key, default=None)

Source from the content-addressed store, hash-verified

157 super().__setitem__(key, list_)
158
159 def setdefault(self, key, default=None):
160 if key not in self:
161 self[key] = default
162 # Do not return default here because __setitem__() may store
163 # another value -- QueryDict.__setitem__() does. Look it up.
164 return self[key]
165
166 def setlistdefault(self, key, default_list=None):
167 if key not in self:

Callers 5

test_setdefaultMethod · 0.95
common_rootsFunction · 0.45
restart_with_reloaderFunction · 0.45
templatizeFunction · 0.45
_populateMethod · 0.45

Calls

no outgoing calls

Tested by 1

test_setdefaultMethod · 0.76