MCPcopy
hub / github.com/psf/requests / __setitem__

Method __setitem__

src/requests/cookies.py:367–374  ·  view source on GitHub ↗

Dict-like __setitem__ for compatibility with client code. Throws exception if there is already a cookie of that name in the jar. In that case, use the more explicit set() method instead.

(
        self, name: str, value: str | Morsel[dict[str, str]] | None
    )

Source from the content-addressed store, hash-verified

365 return self._find_no_duplicates(name)
366
367 def __setitem__(
368 self, name: str, value: str | Morsel[dict[str, str]] | None
369 ) -> None:
370 """Dict-like __setitem__ for compatibility with client code. Throws
371 exception if there is already a cookie of that name in the jar. In that
372 case, use the more explicit set() method instead.
373 """
374 self.set(name, value)
375
376 def __delitem__(self, name: str) -> None:
377 """Deletes a cookie given a name. Wraps ``http.cookiejar.CookieJar``'s

Callers

nothing calls this directly

Calls 1

setMethod · 0.95

Tested by

no test coverage detected