Skip to content

Commit 5acbaa6

Browse files
committed
add a check on init method to ensure that data is an iterable
1 parent 6269b98 commit 5acbaa6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

labelbox/data/annotation_types/collection.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ class LabelList:
2222
"""
2323

2424
def __init__(self, data: Optional[Iterable[Label]] = None):
25-
self._data = [] if data is None else data
25+
if data is None:
26+
self._data = []
27+
elif isinstance(data, Label):
28+
self._data = [data]
29+
else:
30+
self._data = data
2631
self._index = 0
2732

2833
def assign_feature_schema_ids(

0 commit comments

Comments
 (0)