init_decorator()

audobject.init_decorator(*, borrow=None, hide=None, resolvers=None)[source]

Decorator for __init__ function of audobject.Object.

If your class expects an argument a which is passed on as an argument to a class C or to a dictionary with key a, and stored under self.b, you can borrow the argument from b by setting borrow = {'a': 'b'}. This will store a in the YAML representation, even though your class actually does not have a corresponding attribute self.a.

Arguments listed in hidden are not serialized to YAML. Note that objects you borrow attributes from, are also treated as hidden arguments.

If a dictionary of audobject.ValueResolver is passed, matching attributes will be encoded / decoded using the according audobject.ValueResolver.

Parameters
Raises

RuntimeError – if arguments are not assigned to attributes of same name