pg.patch¶
Accessible via pg.patch
, pg.patching.patch
.
- patch(value, rule)[source]¶
Apply patches to a symbolic value.
- Return type:
- Parameters:
value – A symbolic value to patch.
rule –
A patching rule is one of the following: 1) A dict of symbolic paths to the new values. 2) A rebind function defined by signature (k, v) or (k, v, p).
See
pg.Symbolic
.A
pg.patching.Patcher
object.A URL-like string representing an instance of a register Patcher. The format is “<patcher_name>?<arg1>&<arg2>=<val2>”.
A list of the mixtures of above.
- Returns:
Value after applying the patchers. If any patcher returned a new value (by returning a single-item dict that containing ‘’ as key), the return value will be a different object other than value, otherwise value will be returned after applying the patches.
- Raises:
ValueError – Error if the patch name and arguments cannot be parsed successfully.