Skip to content

Commit

Permalink
refine set dtype
Browse files Browse the repository at this point in the history
  • Loading branch information
y1xiaoc committed Oct 18, 2020
1 parent 93c2211 commit 53be5e1
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions dargs/dargs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 53be5e1

Please sign in to comment.