def __init__(self, name, properties): if type(name) is not str: raise TypeError("Expected \"name\" to be a str object") if not isinstance(properties, list): raise TypeError("Expected \"properties\" to be a list") Contract.__init__(self, name) self.properties = properties
def __init__(self, name, backing_type, cases): if type(backing_type) is not str: raise TypeError("Expected \"type\" to be a str object") if not isinstance(cases, list): raise TypeError("Expected \"properties\" to be a list") Contract.__init__(self, name) self.backing_type = backing_type self.cases = cases
def __init__(self, contract_partner, endtime, premium, excess, deductible=0.0): Contract.__init__(self, contract_partner, endtime) assert isinstance(contract_partner, dict) self.policyholder = contract_partner['policyholder'] self.insurer = contract_partner['insurer'] self.obligations['policyholder'] = {'money': premium} self.obligations['insurer'] = {'money': 0} self.excess = excess self.deductible = deductible