From 53be5e19607a4441a46f2bb6d46c855c6775c0f3 Mon Sep 17 00:00:00 2001 From: Yixiao Chen Date: Sat, 17 Oct 2020 23:00:50 -0400 Subject: [PATCH] refine set dtype --- dargs/dargs.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dargs/dargs.py b/dargs/dargs.py index 05ecc91..6d0fc65 100644 --- a/dargs/dargs.py +++ b/dargs/dargs.py @@ -67,13 +67,10 @@ def reorg_dtype(self): if isinstance(self.dtype, type) or self.dtype is None: self.dtype = [self.dtype] # remove duplicate - self.dtype = set(self.dtype) + self.dtype = {dt if type(dt) is type else type(dt) for dt in self.dtype} # check conner cases if self.sub_fields or self.sub_variants: self.dtype.add(list if self.repeat else dict) - if None in self.dtype: - self.dtype.remove(None) - self.dtype.add(type(None)) # and make it compatible with `isinstance` self.dtype = tuple(self.dtype)