MCPcopy
hub / github.com/mitmproxy/mitmproxy / setdefault

Method setdefault

test/mitmproxy/proxy/tutils.py:388–395  ·  view source on GitHub ↗
(self, value: T)

Source from the content-addressed store, hash-verified

386 return self._obj
387
388 def setdefault(self, value: T) -> T:
389 if self._obj is None:
390 if self._cls is not Any and not isinstance(value, self._cls):
391 raise TypeError(
392 f"expected {self._cls.__name__}, got {type(value).__name__}."
393 )
394 self._obj = value
395 return self._obj
396
397 def __repr__(self):
398 return f"Placeholder:{self._obj!r}"

Callers 12

fetchMethod · 0.45
_eqFunction · 0.45
setdefaultMethod · 0.45
setMethod · 0.45
_handle_eventMethod · 0.45
convert_4_5Function · 0.45
convert_18_19Function · 0.45
prettifyMethod · 0.45
__getitem__Method · 0.45
add_flowsMethod · 0.45
add_urlMethod · 0.45
histogramMethod · 0.45

Calls

no outgoing calls

Tested by 1

fetchMethod · 0.36