"rlcompleter" — GNU readline向け補完関数
****************************************

**ソースコード:** Lib/rlcompleter.py

======================================================================

"rlcompleter" モジュールではPythonの識別子やキーワードを定義した
"readline" モジュール向けの補完関数を定義しています。

このモジュールが Unixプラットフォームでimportされ、 "readline" が利用
できるときには、 "Completer" クラスのインスタンスが自動的に作成され、
"complete()" メソッドが "readline" 補完に設定されます。

以下はプログラム例です:

   >>> import rlcompleter
   >>> import readline
   >>> readline.parse_and_bind("tab: complete")
   >>> readline. <TAB PRESSED>
   readline.__doc__          readline.get_line_buffer(  readline.read_init_file(
   readline.__file__         readline.insert_text(      readline.set_completer(
   readline.__name__         readline.parse_and_bind(
   >>> readline.

The "rlcompleter" module is designed for use with Python’s interactive
mode.  A user can add the following lines to his or her initialization
file (identified by the "PYTHONSTARTUP" environment variable) to get
automatic "Tab" completion:

   try:
       import readline
   except ImportError:
       print "Module readline not available."
   else:
       import rlcompleter
       readline.parse_and_bind("tab: complete")

"readline" のないプラットフォームでも、このモジュールで定義される
"Completer" クラスは独自の目的に使えます。


Completerオブジェクト
=====================

Completerオブジェクトは以下のメソッドを持っています:

Completer.complete(text, state)

   *text* の *state* 番目の補完候補を返します。

   If called for *text* that doesn’t include a period character
   ("'.'"), it will complete from names currently defined in
   "__main__", "__builtin__" and keywords (as defined by the "keyword"
   module).

   ピリオドを含む名前の場合、副作用を出さずに名前を最後まで評価しよう
   とします(関数を明示的に呼び出しはしませんが、 "__getattr__()" を呼
   んでしまうことはあります)そして、 "dir()" 関数でマッチする語を見つ
   けます。式を評価中に発生した全ての例外は補足して無視され、 "None"
   を返します。
