From 1a8ad5300a49198761026139a6fe66be505afe98 Mon Sep 17 00:00:00 2001 From: Roman Gräf Date: Tue, 11 Sep 2018 10:51:41 +0000 Subject: Fixed Dict[] and List[] --- configlib/model_impl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configlib/model_impl.py b/configlib/model_impl.py index d18611f..38b811a 100644 --- a/configlib/model_impl.py +++ b/configlib/model_impl.py @@ -92,11 +92,11 @@ def parse_single_item(val_type: Type[object], val, path): if issubclass(val_type, (str, int, float)): # noinspection PyArgumentList return val_type(val) - if isinstance(val_type, List): + if issubclass(val_type, List): if len(val_type.__args__) != 1: raise InvalidConfigTypingException(path + ': List must be supplied exactly one type') return parse_list_impl(val_type.__args__[0], val, path) - if isinstance(val_type, Dict): + if issubclass(val_type, Dict): if len(val_type.__args__) != 2: raise InvalidConfigTypingException(path + ': Dict must be supplied exactly two types') if val_type.__args__[0] != str: -- cgit