MCPcopy Create free account
hub / github.com/EasyIME/PIME / __init__

Method __init__

python/python3/tornado/gen.py:367–384  ·  view source on GitHub ↗
(self, *args: Future, **kwargs: Future)

Source from the content-addressed store, hash-verified

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."""

Callers

nothing calls this directly

Calls 3

future_add_done_callbackFunction · 0.90
listFunction · 0.85
itemsMethod · 0.80

Tested by

no test coverage detected