IPython 8.4.0 Pypi GitHub Homepage
Other Docs
NotesParameters
rectify_completions(text: str, completions: Iterable[IPython.core.completer.Completion], *, _debug: bool = False) -> Iterable[IPython.core.completer.Completion]
warning

Unstable

This function is unstable, API may change without warning. It will also raise unless use in proper context manager.

Notes

jedi.api.classes.Completion s returned by Jedi may not have the same start and end, though the Jupyter Protocol requires them to behave like so. This will readjust the completion to have the same start and end by padding both extremities with surrounding text.

During stabilisation should support a _debug option to log which completion are return by the IPython completer and not found in Jedi in order to make upstream bug report.

Parameters

text : str

text that should be completed.

completions : Iterator[Completion]

iterator over the completions to rectify

_debug : bool

Log failed completion

Rectify a set of completions to all have the same start and end

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /IPython/core/completer.py#465
type: <class 'function'>
Commit: