You are viewing an older version (9.3.0). Go to latest (9.13.0)
{ } Raw JSON

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, optional

Text to perform the completion on. If not given, the line buffer is split using the instance's CompletionSplitter object.

line_buffer : string, optional

If 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, optional

Index 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 : str

Text that was actually used in the completion.

matches : list

A list of completion matches.

Notes

This API is likely to be deprecated and replaced by IPCompleter.completions in the future.

Aliases

  • IPython.core.completer.IPCompleter.complete