From a83607fd81ba787dde0b71bf9c5bc78c8d6089d9 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Wed, 27 Oct 2021 14:24:43 +0200 Subject: [PATCH] Fixed subclass support for Iterable --- src/cpl_query/extension/iterable_abc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cpl_query/extension/iterable_abc.py b/src/cpl_query/extension/iterable_abc.py index 673f6167..f10547f6 100644 --- a/src/cpl_query/extension/iterable_abc.py +++ b/src/cpl_query/extension/iterable_abc.py @@ -27,7 +27,8 @@ class IterableABC(ABC, list): def all(self, func: Callable) -> bool: pass def append(self, __object: object) -> None: - if self._type is not None and type(__object) != self._type and not isinstance(type(__object), self._type): + if self._type is not None and type(__object) != self._type and not isinstance(type(__object), self._type) \ + and not issubclass(type(__object), self._type): raise Exception(f'Unexpected type: {type(__object)}') if len(self) == 0 and self._type is None: