bind_to
- PlasmaCalcs.tools.oop_tools.binding.bind_to(*targets)
returns a function decorator which binds f to target.(f.__name__) for target in targets.
This decorator returns the unbound version of f.Example, equivalent to defining foo inside MyClass, and also in the local namespace:@bind_to(MyClass)def foo(self, args):# <code for foo>If you want foo to no longer be defined in the local namespace, you can delete it afterwards:del fooIf you want to do this for many functions but don’t want to delete each one manually,consider using Binding() instead.