Skip to main content

Aliases

  • hookfunc
  • replaceclosure
  • detourfunction
  • detour_function

Arguments

function
required
Function to patch. Passing a non-function raises a type error.
function
required
Function whose function is installed into or mapped onto target. Passing a non-function raises a type error.

Returns

function
Callable copy of the original target behavior before the hook was installed.

Example

Patch a function closure and keep a cloned original.