diff --git a/python/pyrogue/_HelperFunctions.py b/python/pyrogue/_HelperFunctions.py index bf5b77761..7fb2df430 100644 --- a/python/pyrogue/_HelperFunctions.py +++ b/python/pyrogue/_HelperFunctions.py @@ -349,13 +349,13 @@ def _var_representer(dumper, data): ------- """ - if type(data.value) == bool: + if isinstance(data.value, bool): enc = 'tag:yaml.org,2002:bool' elif data.enum is not None: enc = 'tag:yaml.org,2002:str' - elif type(data.value) == int: + elif isinstance(data.value, int): enc = 'tag:yaml.org,2002:int' - elif type(data.value) == float: + elif isinstance(data.value, float): enc = 'tag:yaml.org,2002:float' else: enc = 'tag:yaml.org,2002:str' diff --git a/python/pyrogue/_Variable.py b/python/pyrogue/_Variable.py index 4d22400d5..973aaeb72 100644 --- a/python/pyrogue/_Variable.py +++ b/python/pyrogue/_Variable.py @@ -214,7 +214,7 @@ def __init__(self, *, self._enum = disp elif isinstance(disp, list): self._enum = {k:str(k) for k in disp} - elif type(value) == bool and enum is None: + elif isinstance(value, bool) and enum is None: self._enum = {False: 'False', True: 'True'} if self._enum is not None: