MCPcopy Index your code
hub / github.com/RustPython/RustPython / set

Method set

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

Source from the content-addressed store, hash-verified

344 return K.lower() in self._reserved
345
346 def set(self, key, val, coded_val):
347 if key.lower() in self._reserved:
348 raise CookieError('Attempt to set a reserved key %r' % (key,))
349 if not _is_legal_key(key):
350 raise CookieError('Illegal key %r' % (key,))
351 if _has_control_character(key, val, coded_val):
352 raise CookieError(
353 "Control characters are not allowed in cookies %r %r %r" % (key, val, coded_val,))
354
355 # It's a good key, so save it.
356 self._key = key
357 self._value = val
358 self._coded_value = coded_val
359
360 def __getstate__(self):
361 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