MCPcopy Index your code
hub / github.com/python/cpython / completer

Function completer

Lib/sqlite3/_completer.py:91–111  ·  view source on GitHub ↗
(con)

Source from the content-addressed store, hash-verified

89
90@contextmanager
91def completer(con):
92 try:
93 import readline
94 except ImportError:
95 yield
96 return
97
98 old_completer = readline.get_completer()
99 def complete(text, state):
100 return _complete(con, text, state)
101 try:
102 readline.set_completer(complete)
103 if readline.backend == "editline":
104 # libedit uses "^I" instead of "tab"
105 command_string = "bind ^I rl_complete"
106 else:
107 command_string = "tab: complete"
108 readline.parse_and_bind(command_string)
109 yield
110 finally:
111 readline.set_completer(old_completer)

Callers 2

mainFunction · 0.90
runMethod · 0.85

Calls 3

get_completerMethod · 0.80
set_completerMethod · 0.80
parse_and_bindMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…