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

Function _get_target

Lib/unittest/mock.py:1677–1683  ·  view source on GitHub ↗
(target)

Source from the content-addressed store, hash-verified

1675
1676
1677def _get_target(target):
1678 try:
1679 target, attribute = target.rsplit('.', 1)
1680 except (TypeError, ValueError, AttributeError):
1681 raise TypeError(
1682 f"Need a valid target to patch. You supplied: {target!r}")
1683 return partial(pkgutil.resolve_name, target), attribute
1684
1685
1686def _patch_object(

Callers 2

with_custom_patchMethod · 0.90
patchFunction · 0.85

Calls 2

partialClass · 0.90
rsplitMethod · 0.45

Tested by 1

with_custom_patchMethod · 0.72