From ae8064787018031b4324c653dec9e46faa3c6a69 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sun, 12 Mar 2023 12:41:33 -0400 Subject: [PATCH] Use `isinstance()` instead of `type() ==` --- tts_yaml_unpacker.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tts_yaml_unpacker.py b/tts_yaml_unpacker.py index 89ff887..4867279 100755 --- a/tts_yaml_unpacker.py +++ b/tts_yaml_unpacker.py @@ -59,11 +59,11 @@ def normalize_value(value): return rounded def recursively_normalize_values(d): - if type(d) == dict: + if isinstance(d, dict): return {key: recursively_normalize_values(value) for key, value in d.items()} - elif type(d) == list: + elif isinstance(d, list): return [recursively_normalize_values(value) for value in d] - elif type(d) == float: + elif isinstance(d, float): return normalize_value(d) else: return d