MCPcopy
hub / github.com/encode/httpx / remove

Method remove

httpx/_urls.py:567–580  ·  view source on GitHub ↗

Return a new QueryParams instance, removing the value of a key. Usage: q = httpx.QueryParams("a=123") q = q.remove("a") assert q == httpx.QueryParams("")

(self, key: str)

Source from the content-addressed store, hash-verified

565 return q
566
567 def remove(self, key: str) -> QueryParams:
568 """
569 Return a new QueryParams instance, removing the value of a key.
570
571 Usage:
572
573 q = httpx.QueryParams("a=123")
574 q = q.remove("a")
575 assert q == httpx.QueryParams("")
576 """
577 q = QueryParams()
578 q._dict = dict(self._dict)
579 q._dict.pop(str(key), None)
580 return q
581
582 def merge(self, params: QueryParamTypes | None = None) -> QueryParams:
583 """

Callers 2

test_queryparam_removeFunction · 0.95
copy_remove_paramMethod · 0.80

Calls 1

QueryParamsClass · 0.85

Tested by 1

test_queryparam_removeFunction · 0.76