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):
Line 69 in
get_xml_type()reads:This is redundant. List, set and tuple types are also instances of collections.Iterable. So the line can be changed to:
Same with line 127 in
convert():It can be changed to:
Same with line 158 in
convert_dict():It can be changed to:
Same with line 193 in
convert_list():It can be changed to: