nip.utils.runtime_module.modify_function#
- nip.utils.runtime_module.modify_function(f, globals={}, name=None, code=None, defaults=None, closure=None)[source]#
Creates a copy of a function, changing its attributes.
- Parameters:
globals – Will be added to the function’s globals.
name – The new function name. Set to
None
to use the function’s original name.code – The new function code object. Set to
None
to use the function’s original code object.defaults – The new function defaults. Set to
None
to use the function’s original defaults.closure – The new function closure. Set to
None
to use the function’s original closure.
Warning
This function can be potentially dangerous.