From df0c7e9f52656d343fe41ff7beb35272344f64a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=AA=E5=95=B8?= Date: Wed, 16 Oct 2019 14:47:37 +0800 Subject: [PATCH] using isinstance to add subclass support --- objectpath/core/interpreter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/objectpath/core/interpreter.py b/objectpath/core/interpreter.py index 1e94e7e..1b7daa7 100644 --- a/objectpath/core/interpreter.py +++ b/objectpath/core/interpreter.py @@ -42,7 +42,7 @@ def __init__(self, obj, cfg=None): if self.D: super(Tree, self).__init__() def setData(self, obj): - if type(obj) in ITER_TYPES + [dict]: + if isinstance(obj, tuple(ITER_TYPES + [dict])): self.data = obj def setObjectGetter(self, object_getter_cb):