OptionalArgDecorator
- class odl.core.util.vectorization.OptionalArgDecorator(*args, **kwargs)[source]
Bases:
objectAbstract class to create decorators with optional arguments.
This class implements the functionality of a decorator that can be used with and without arguments, i.e. the following patterns both work:
@decorator def myfunc(x, *args, **kwargs): pass @decorator(param, **dec_kwargs) def myfunc(x, *args, **kwargs): pass
The arguments to the decorator are passed on to the underlying wrapper.
To use this class, subclass it and implement the static
_wrappermethod.- __init__()