rest25/library/rlcompleter.rst => rest262/library/rlcompleter.rst
15and its :meth:`complete` method is set as the :mod:`readline` completer.
16
17Example::
18
19   >>> import rlcompleter
20   >>> import readline
21   >>> readline.parse_and_bind("tab: complete")
22   >>> readline. <TAB PRESSED>
n23-   readline.__doc__          readline.get_line_buffer  readline.read_init_file
n23+   readline.__doc__          readline.get_line_buffer(  readline.read_init_file(
24-   readline.__file__         readline.insert_text      readline.set_completer
24+   readline.__file__         readline.insert_text(      readline.set_completer(
25-   readline.__name__         readline.parse_and_bind
25+   readline.__name__         readline.parse_and_bind(
26   >>> readline.
27
28The :mod:`rlcompleter` module is designed for use with Python's interactive
29mode.  A user can add the following lines to his or her initialization file
30(identified by the :envvar:`PYTHONSTARTUP` environment variable) to get
31automatic :kbd:`Tab` completion::
32
33   try:
56
57   If called for *text* that doesn't include a period character (``'.'``), it will
58   complete from names currently defined in :mod:`__main__`, :mod:`__builtin__` and
59   keywords (as defined by the :mod:`keyword` module).
60
61   If called for a dotted name, it will try to evaluate anything without obvious
62   side-effects (functions will not be evaluated, but it can generate calls to
63   :meth:`__getattr__`) up to the last part, and find matches for the rest via the
t64-   :func:`dir` function.
t64+   :func:`dir` function.  Any exception raised during the evaluation of the
65+   expression is caught, silenced and :const:`None` is returned.
65
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op