Duplication in detecting a list, tuple, set or iterable data type
quandyfactory opened this issue · 1 comments
quandyfactory commented
Line 69 in get_xml_type()
reads:
if type(val).__name__ in ('list', 'set', 'tuple') or isinstance(val, collections.Iterable):
This is redundant. List, set and tuple types are also instances of collections.Iterable. So the line can be changed to:
if isinstance(val, collections.Iterable):
Same with line 127 in convert()
:
if type(obj) in (list, set, tuple) or isinstance(obj, collections.Iterable):
It can be changed to:
if isinstance(obj, collections.Iterable):
Same with line 158 in convert_dict()
:
elif type(val) in (list, set, tuple) or isinstance(val, collections.Iterable):
It can be changed to:
elif isinstance(val, collections.Iterable):
Same with line 193 in convert_list()
:
elif type(item) in (list, set, tuple) or isinstance(item, collections.Iterable):
It can be changed to:
elif isinstance(item, collections.Iterable):
quandyfactory commented
Fixed in version 1.6.0.