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

Method set

Lib/http/cookies.py:353–365  ·  view source on GitHub ↗
(self, key, val, coded_val)

Source from the content-addressed store, hash-verified

351 return K.lower() in self._reserved
352
353 def set(self, key, val, coded_val):
354 if key.lower() in self._reserved:
355 raise CookieError('Attempt to set a reserved key %r' % (key,))
356 if not _is_legal_key(key):
357 raise CookieError('Illegal key %r' % (key,))
358 if _has_control_character(key, val, coded_val):
359 raise CookieError(
360 "Control characters are not allowed in cookies %r %r %r" % (key, val, coded_val,))
361
362 # It's a good key, so save it.
363 self._key = key
364 self._value = val
365 self._coded_value = coded_val
366
367 def __getstate__(self):
368 return {

Callers 8

test_setterMethod · 0.95
test_eqMethod · 0.95
test_copyMethod · 0.95
test_pickleMethod · 0.95
test_reprMethod · 0.95
__setMethod · 0.45

Calls 3

CookieErrorClass · 0.85
_has_control_characterFunction · 0.85
lowerMethod · 0.45

Tested by 7

test_setterMethod · 0.76
test_eqMethod · 0.76
test_copyMethod · 0.76
test_pickleMethod · 0.76
test_reprMethod · 0.76