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

Method readline_completion

Lib/pdb.py:3218–3236  ·  view source on GitHub ↗
(self, completer)

Source from the content-addressed store, hash-verified

3216
3217 @contextmanager
3218 def readline_completion(self, completer):
3219 try:
3220 import readline
3221 except ImportError:
3222 yield
3223 return
3224
3225 old_completer = readline.get_completer()
3226 try:
3227 readline.set_completer(completer)
3228 if readline.backend == "editline":
3229 # libedit uses "^I" instead of "tab"
3230 command_string = "bind ^I rl_complete"
3231 else:
3232 command_string = "tab: complete"
3233 readline.parse_and_bind(command_string)
3234 yield
3235 finally:
3236 readline.set_completer(old_completer)
3237
3238 @contextmanager
3239 def _sigint_handler(self):

Callers 1

cmdloopMethod · 0.95

Calls 3

get_completerMethod · 0.80
set_completerMethod · 0.80
parse_and_bindMethod · 0.80

Tested by

no test coverage detected