qnet.utils.properties_for_args module

Class decorator for adding properties for arguments

Summary

Functions:

properties_for_args For a class with an attribute arg_names containing a list of names, add a property for every name in that list.

Reference

qnet.utils.properties_for_args.properties_for_args(cls, arg_names='_arg_names')[source]

For a class with an attribute arg_names containing a list of names, add a property for every name in that list.

It is assumed that there is an instance attribute self._<arg_name>, which is returned by the arg_name property. The decorator also adds a class attribute _has_properties_for_args that may be used to ensure that a class is decorated.