(all the names of the classes are debatable. This is just to form a general idea of the changes being made to the bears)
class bear_annotations():
class acceptable_values_type_3_setting():
setting_name = [list of acceptable values]
class config_file_names_type_4_setting():
setting_name = [list of acceptable config files]
class constraints_type_2_setting():
class setting_name():
min = val1
max = val2
range = (val3, val4)
from contracts import contract, new_contract
class Mybear():
new_contract('a', annotate_a)
new_contract('b', annotate_b)
@deprecate_settings()
@contract(a='a', b='b')
def run(a, b):
pass
Now the functions annotate_a()
and annotate_b
can be defined and checks can be added based on their type of settings
These functions either return True or False based on the constraints (contracts
can be again applied to these and be made mandatory)
All the constraining values should be in the bear_annotations
class for storing metadata.