rl 2.4 – GNU Readline Bindings

Alternative Python bindings for GNU Readline.

Package Contents

rl exports the following components:

Interface to the readline completer. Used to configure the completion aspects of readline.
Interface to the active readline completion. Used to interact with readline when a completion is in progress.
Interface to the readline history. Used to read and write history files and to manipulate history entries.
The readline bindings module. Contains everything known from the standard library plus extensions specific to the rl package. The completer, completion, and history objects make use of this module, and you should rarely need to interact with it directly.
A factory turning any callable into a completion entry function that can be handed to readline.
A decorator printing exceptions to stderr. Useful when writing Python completions and hooks, as exceptions occurring there are usually swallowed by the in-between C code.

Readline Completion

Completion is the process initiated when the user presses the TAB key. It has three phases: Word breaking, match generation, and match display.

For each phase, readline provides configuration settings and hooks that allow applications to control the way the library behaves. See the Completer and Completion classes for detailed descriptions of available properties.

Call Graph

A calling sequence for filename completion may look like this:

Readline History

History allows readline to save and later recall lines the user has entered. The history object provides a list-like interface to the history buffer as well as functions to persist the history between sessions.

Upstream Documentation

The GNU Readline Library and the GNU History Library.

Indices and Tables