(self, *args: Future, **kwargs: Future)
| 365 | _unfinished = {} # type: Dict[Future, Union[int, str]] |
| 366 | |
| 367 | def __init__(self, *args: Future, **kwargs: Future) -> None: |
| 368 | if args and kwargs: |
| 369 | raise ValueError("You must provide args or kwargs, not both") |
| 370 | |
| 371 | if kwargs: |
| 372 | self._unfinished = dict((f, k) for (k, f) in kwargs.items()) |
| 373 | futures = list(kwargs.values()) # type: Sequence[Future] |
| 374 | else: |
| 375 | self._unfinished = dict((f, i) for (i, f) in enumerate(args)) |
| 376 | futures = args |
| 377 | |
| 378 | self._finished = collections.deque() # type: Deque[Future] |
| 379 | self.current_index = None # type: Optional[Union[str, int]] |
| 380 | self.current_future = None # type: Optional[Future] |
| 381 | self._running_future = None # type: Optional[Future] |
| 382 | |
| 383 | for future in futures: |
| 384 | future_add_done_callback(future, self._done_callback) |
| 385 | |
| 386 | def done(self) -> bool: |
| 387 | """Returns True if this iterator has no more results.""" |
nothing calls this directly
no test coverage detected