]> granicus.if.org Git - python/commit
Word completion for the new readline.set_completer() function.
authorGuido van Rossum <guido@python.org>
Fri, 26 Sep 1997 22:04:56 +0000 (22:04 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 26 Sep 1997 22:04:56 +0000 (22:04 +0000)
commit2781fbe46c7f8d8e391c3f3f3e8692b451e6142f
tree50686fded5e2294f3b68154e6b37f43bfe4853e3
parent290900a5d76a5d9763bc1d1bb228845cda5754fa
Word completion for the new readline.set_completer() function.

When completing a simple identifier, it completes keywords, built-ins
and globals in __main__; when completing NAME.NAME..., it evaluates
(!) the expression up to the last dot and completes its attributes.

It's very cool to do "import string" type "string.", hit the
completion key (twice), and see the list of names defined by the
string module!

Tip: to use the tab key as the completion key, call

    readline.parse_and_bind("tab: complete")
Lib/rlcompleter.py [new file with mode: 0644]