def __init__(self, data_to_convert): if not isinstance(data_to_convert, (str, list)): raise WrongParameterType( f"<data_to_convert> should be {str} or {list}, {type(data_to_convert)} given." ) super().__init__(data_to_convert)
def __init__(self, data): if not isinstance(data, str): raise WrongParameterType( f"<data> ({data}) should be {str}, {type(data)} given." ) self.data = data
def __init__(self, data_to_convert): if not isinstance(data_to_convert, str): raise WrongParameterType( f"<data_to_convert> should be {str}, {type(data_to_convert)} given." ) super().__init__(data_to_convert) self.converted_data = self.to_right_url()
def __init__(self, data_to_convert): if not isinstance(data_to_convert, str): raise WrongParameterType( f"<data_to_convert> should be {str}, {type(data_to_convert)} given." ) super().__init__(data_to_convert) for to_return, possibilities in self.months.items(): if self.data_to_convert.lower() in possibilities: self.converted_data = to_return break