MCPcopy
hub / github.com/scrapy/scrapy / MutableAsyncChain

Class MutableAsyncChain

scrapy/utils/python.py:326–341  ·  view source on GitHub ↗

Similar to MutableChain but for async iterables

Source from the content-addressed store, hash-verified

324
325
326class MutableAsyncChain(AsyncIterator[_T]):
327 """
328 Similar to MutableChain but for async iterables
329 """
330
331 def __init__(self, *args: Iterable[_T] | AsyncIterator[_T]):
332 self.data: AsyncIterator[_T] = _async_chain(*args)
333
334 def extend(self, *iterables: Iterable[_T] | AsyncIterator[_T]) -> None:
335 self.data = _async_chain(self.data, _async_chain(*iterables))
336
337 def __aiter__(self) -> Self:
338 return self
339
340 async def __anext__(self) -> _T:
341 return await self.data.__anext__()
342
343
344def _looks_like_import_path(value: str) -> bool:

Callers 4

Calls

no outgoing calls

Tested by 2