Skip to content

Commit

Permalink
Implement support for auto iterable conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycrosley committed Dec 1, 2015
1 parent 0bd20dd commit dda3a99
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hug/output_format.py
Expand Up @@ -47,8 +47,9 @@ def _json_converter(item):
return item.decode('utf8')
except UnicodeDecodeError:
return base64.b64encode(item)
elif isinstance(item, set):
elif hasattr(item, '__iter__'):
return list(item)

raise TypeError("Type not serializable")


Expand Down

0 comments on commit dda3a99

Please sign in to comment.