diff --git a/cic/utils.py b/cic/utils.py index 9f934fa..b6753cf 100644 --- a/cic/utils.py +++ b/cic/utils.py @@ -4,15 +4,15 @@ def object_to_str(obj, keys): for key in keys: value = eval("obj." + key) key = key.replace("()", "") - if type(value) == str: + if isinstance(value, str): s += f"{key} = {value}\n" - elif type(value) == list: + elif isinstance(value, list): for idx, vv in enumerate(value): if not vv: s += f"{key}[{idx}] = \n" continue s += f"{key}[{idx}] = {vv}\n" - elif type(value) == dict: + elif isinstance(value, dict): for vv_key in value.keys(): vv_value = value[vv_key] if not vv_value: