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

bundles / IPython 9.11.0 / IPython / core / completer / match_dict_keys

function

IPython.core.completer:match_dict_keys

source: /IPython/core/completer.py :1483

Signature

def   match_dict_keys ( keys : list[Union[str, bytes, tuple[Union[str, bytes], ...]]] prefix : str delims : str extra_prefix : Optional[tuple[Union[str, bytes], ...]] = None )  →  tuple[str, int, dict[str, _DictKeyState]]

Summary

Used by dict_key_matches, matching the prefix to a list of keys

Parameters

keys

list of keys in dictionary currently being completed.

prefix

Part of the text already typed by the user. E.g. mydict[b'fo

delims

String of delimiters to consider when finding the current key.

extra_prefix : optional

Part of the text already typed in multi-key index cases. E.g. for mydict['foo', "bar", 'b, this would be ('foo', 'bar').

Returns

: A tuple of three elements: ``quote``, ``token_start``, ``matched``, with
: ``quote`` being the quote that need to be used to close current string.
: ``token_start`` the position where the replacement should start occurring,
: ``matches`` a dictionary of replacement/completion keys on keys and values

indicating whether the state.

Aliases

  • IPython.core.completer.match_dict_keys