Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docarray/array/storage/memory/seqlike.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ def insert(self, index: int, value: 'Document'):
"""
self._data.insert(index, value)

def append(self, value: 'Document'):
"""Append `doc` to the end of the array.

:param value: The doc needs to be appended.
"""
self._data.append(value)
if not self._needs_id2offset_rebuild:
self._id_to_index[value.id] = len(self) - 1
Comment on lines +20 to +27
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you implement faster extend as well?


def __eq__(self, other):
return (
type(self) is type(other)
Expand Down