On this page
rlcompleter.Completer
Up: rlcompleter
Rel: rlcompleter
Ref: docs.python.org — rlcompleter.Completer
Tags: #public #python3 #stdlib #rlcompleter
Import
import rlcompleter
from rlcompleter import Completer
Signature & Overview
rlcompleter.Completer(namespace=None)
rlcompleter.Completer class.
Methods & Attributes
Completer.attr_matches(self, text)— Compute matches when text contains a dot.Completer.complete(self, text, state)— Return the next possible completion for 'text'.Completer.global_matches(self, text)— Compute matches when text is a simple name.
Usage
import rlcompleter
c = rlcompleter.Completer({'alpha': 1, 'beta': 2})
assert c.complete('al', 0) == 'alpha' and c.complete('al', 1) is None
Gotchas
- Attribute completion (
obj.attr) evaluatesobj: Never expose on untrusted input.
REPL Inspect
from rlcompleter import Completer
help(Completer)
Linked from
Related notes
- tuts/python3/stdlib_module/rlcompleter Linked here; links to this page; shared tags: #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib
- tuts/c/stdlib/assert/static_assert shared tags: #stdlib
- tuts/c/stdlib/ctype shared tags: #stdlib
- tuts/c/stdlib/ctype/isalpha shared tags: #stdlib
- tuts/c/stdlib/ctype/isdigit shared tags: #stdlib
- tuts/c/stdlib/ctype/isspace shared tags: #stdlib
- tuts/c/stdlib/ctype/tolower shared tags: #stdlib