Refactor to one isinstance() call

This commit is contained in:
Isaiah Odhner 2023-05-29 00:58:35 -04:00
parent fab2791fc6
commit fe443f4c07

View File

@ -282,7 +282,7 @@ class PropertiesTree(Tree[object]):
elif isinstance(data, list):
length = len(data) # type: ignore
node.set_label(Text(f"[] {name} ({length})"))
elif isinstance(data, str) or isinstance(data, int) or isinstance(data, float) or isinstance(data, bool) or data is None:
elif isinstance(data, (str, int, float, bool, type(None))):
node.allow_expand = False
if name:
label = with_name(PropertiesTree.highlighter(repr(data)))