bundles / IPython 9.5.0 / IPython / core / completer / IPCompleter / _completions
function
IPython.core.completer:IPCompleter._completions
source: /IPython/core/completer.py :3188
Signature
def _completions ( self , full_text : str , offset : int , * , _timeout ) → Iterator[Completion] Summary
Core completion module.Same signature as completions, with the extra timeout parameter (in seconds).
Extended Summary
Computing jedi's completion .type can be quite expensive (it is a lazy property) and can require some warm-up, more warm up than just computing the name of a completion. The warm-up can be :
Long warm-up the first time a module is encountered after
install/update: actually build parse/inference tree.
first time the module is encountered in a session: load tree from
disk.
We don't want to block completions for tens of seconds so we give the completer a "budget" of _timeout seconds per invocation to compute completions types, the completions that have not yet been computed will be marked as "unknown" an will have a chance to be computed next round are things get cached.
Keep in mind that Jedi is not the only thing treating the completion so keep the timeout short-ish as if we take more than 0.3 second we still have lots of processing to do.
Aliases
-
IPython.core.completer.IPCompleter._completions