We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
tee
Query
1 parent 796f51c commit fec7cdaCopy full SHA for fec7cda
jsonpath/fluent_api.py
@@ -123,3 +123,10 @@ def last(self) -> Optional[JSONPathMatch]:
123
return next(iter(self.tail(1)))
124
except StopIteration:
125
return None
126
+
127
+ def tee(self, n: int = 2) -> Tuple[Query, ...]:
128
+ """Return _n_ independent queries by teeing this query's match iterable.
129
130
+ It is not safe to use a `Query` instance after calling `tee()`.
131
+ """
132
+ return tuple(Query(it) for it in itertools.tee(self._it, n))
0 commit comments