MCPcopy Index your code
hub / github.com/python/cpython / setdefault

Method setdefault

Lib/http/cookies.py:310–316  ·  view source on GitHub ↗
(self, key, val=None)

Source from the content-addressed store, hash-verified

308 dict.__setitem__(self, K, V)
309
310 def setdefault(self, key, val=None):
311 key = key.lower()
312 if key not in self._reserved:
313 raise CookieError("Invalid attribute %r" % (key,))
314 if _has_control_character(key, val):
315 raise CookieError("Control characters are not allowed in cookies %r %r" % (key, val,))
316 return dict.setdefault(self, key, val)
317
318 def __eq__(self, morsel):
319 if not isinstance(morsel, Morsel):

Callers 11

test_setdefaultMethod · 0.95
decode_paramsFunction · 0.45
process_framesMethod · 0.45
collectMethod · 0.45
__getattr__Method · 0.45
compile_keymapFunction · 0.45
encoder.pyFile · 0.45
__new__Method · 0.45
add_handlerMethod · 0.45

Calls 3

CookieErrorClass · 0.85
_has_control_characterFunction · 0.85
lowerMethod · 0.45

Tested by 2

test_setdefaultMethod · 0.76