patchit

tollan.utils.patchit(obj, name, pass_patched=False)[source]

Return a decorator that replace attribute with decorated item.

Parameters
objobject

The object to alter.

namestr

The name of the attribute to replace.

pass_patchedbool

If set to True, the original attribute will be passed to as the first argument to the decorated function.