Skip to content

Commit

Permalink
Add extend() method to ResultSet
Browse files Browse the repository at this point in the history
  • Loading branch information
olafmersmann committed Jan 29, 2025
1 parent f6655fd commit 234244c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/cocoviz/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,17 @@ def append(self, result: Result) -> ResultSet:
self._results.append(result)
return self

def extend(self, results: Sequence[Result]):
"""Extend a ResultSet with a sequence of `Result`s or another `ResultSetǹ.
Parameters
----------
results: Sequence[Result] or Resultset:
Results to add to this result set.
"""
for result in results:
self.append(result)

def filter(self, function: Callable[[Result], bool]) -> ResultSet:
"""Return a ResultSet containing the results for which `function` returns `True`
Expand Down

0 comments on commit 234244c

Please sign in to comment.