This is a development version (9.18.0.dev) and may be unstable.Go to latest (9.17.0)
{ } Raw JSON

bundles / IPython 9.18.0.dev / IPython / core / completer / match_dict_keys

function

IPython.core.completer:match_dict_keys

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

Signature

def match_dict_keys(keys: list[str | bytes | tuple[str | bytes, ...]], prefix: str, delims: str, extra_prefix: tuple[str | bytes, ...] | None = 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