bundles / IPython 9.3.0 / IPython / core / completer / IPCompleter / complete
function
IPython.core.completer:IPCompleter.complete
source: /IPython/core/completer.py :3300
Signature
def complete ( self , text = None , line_buffer = None , cursor_pos = None ) → tuple[str, Sequence[str]] Summary
Find completions for the given text and line context.
Extended Summary
Note that both the text and the line_buffer are optional, but at least one of them must be given.
Parameters
text: string, optionalText to perform the completion on. If not given, the line buffer is split using the instance's CompletionSplitter object.
line_buffer: string, optionalIf not given, the completer attempts to obtain the current line buffer via readline. This keyword allows clients which are requesting for text completions in non-readline contexts to inform the completer of the entire text.
cursor_pos: int, optionalIndex of the cursor in the full line buffer. Should be provided by remote frontends where kernel has no access to frontend state.
Returns
: Tuple of two items:text: strText that was actually used in the completion.
matches: listA list of completion matches.
Notes
This API is likely to be deprecated and replaced by
IPCompleter.completionsin the future.
Aliases
-
IPython.core.completer.IPCompleter.complete