File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 14
14
from __future__ import absolute_import
15
15
16
16
import abc
17
+ from collections .abc import Iterable
17
18
import csv
18
19
import io
19
20
import json
@@ -202,7 +203,7 @@ def serialize(self, data):
202
203
203
204
Args:
204
205
data (object): Data to be serialized. The data can be a string,
205
- list of JSON serializable objects, or a file-like object.
206
+ iterable of JSON serializable objects, or a file-like object.
206
207
207
208
Returns:
208
209
str: The data serialized as a string containing newline-separated
@@ -211,7 +212,7 @@ def serialize(self, data):
211
212
if isinstance (data , str ):
212
213
return data
213
214
214
- if isinstance (data , list ):
215
+ if isinstance (data , Iterable ):
215
216
return "\n " .join (json .dumps (element ) for element in data )
216
217
217
218
if hasattr (data , "read" ):
You can’t perform that action at this time.
0 commit comments