{
    "mode": "pydoc",
    "parameter": "rlcompleter",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/pydoc/rlcompleter/json",
    "generated": "2026-06-02T14:27:49Z",
    "sections": {
        "NAME": {
            "content": "rlcompleter - Word completion for GNU readline.\n",
            "subsections": []
        },
        "MODULE REFERENCE": {
            "content": "https://docs.python.org/3.10/library/rlcompleter.html\n\nThe following documentation is automatically generated from the Python\nsource files.  It may be incomplete, incorrect or include features that\nare considered implementation detail and may vary between Python\nimplementations.  When in doubt, consult the module reference at the\nlocation listed above.\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The completer completes keywords, built-ins and globals in a selectable\nnamespace (which defaults to main); when completing NAME.NAME..., it\nevaluates (!) the expression up to the last dot and completes its attributes.\n\nIt's very cool to do \"import sys\" type \"sys.\", hit the completion key (twice),\nand see the list of names defined by the sys module!\n\nTip: to use the tab key as the completion key, call\n\nreadline.parseandbind(\"tab: complete\")\n\nNotes:\n\n- Exceptions raised by the completer function are *ignored* (and generally cause\nthe completion to fail).  This is a feature -- since readline sets the tty\ndevice in raw (or cbreak) mode, printing a traceback wouldn't work well\nwithout some complicated hoopla to save, reset and restore the tty state.\n\n- The evaluation of the NAME.NAME... form may cause arbitrary application\ndefined code to be executed if an object with a getattr hook is found.\nSince it is the responsibility of the application (or the user) to enable this\nfeature, I consider this an acceptable risk.  More complicated expressions\n(e.g. function calls or indexing operations) are *not* evaluated.\n\n- When the original stdin is not a tty device, GNU readline is never\nused, and this module (and the readline module) are silently inactive.\n",
            "subsections": []
        },
        "CLASSES": {
            "content": "builtins.object\nCompleter\n",
            "subsections": [
                {
                    "name": "class Completer",
                    "content": "|  Completer(namespace=None)\n|\n|  Methods defined here:\n|\n|  init(self, namespace=None)\n|      Create a new completer for the command line.\n|\n|      Completer([namespace]) -> completer instance.\n|\n|      If unspecified, the default namespace where completions are performed\n|      is main (technically, main.dict). Namespaces should be\n|      given as dictionaries.\n|\n|      Completer instances should be used as the completion mechanism of\n|      readline via the setcompleter() call:\n|\n|      readline.setcompleter(Completer(mynamespace).complete)\n|\n|  attrmatches(self, text)\n|      Compute matches when text contains a dot.\n|\n|      Assuming the text is of the form NAME.NAME....[NAME], and is\n|      evaluable in self.namespace, it will be evaluated and its attributes\n|      (as revealed by dir()) are used as possible completions.  (For class\n|      instances, class members are also considered.)\n|\n|      WARNING: this can still invoke arbitrary C code, if an object\n|      with a getattr hook is evaluated.\n|\n|  complete(self, text, state)\n|      Return the next possible completion for 'text'.\n|\n|      This is called successively with state == 0, 1, 2, ... until it\n|      returns None.  The completion should begin with 'text'.\n|\n|  globalmatches(self, text)\n|      Compute matches when text is a simple name.\n|\n|      Return a list of all keywords, built-in functions and names currently\n|      defined in self.namespace that match.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n"
                }
            ]
        },
        "DATA": {
            "content": "all = ['Completer']\n",
            "subsections": []
        },
        "FILE": {
            "content": "/usr/lib/python3.10/rlcompleter.py\n\n",
            "subsections": []
        }
    },
    "summary": "rlcompleter - Word completion for GNU readline.",
    "flags": [],
    "examples": [],
    "see_also": []
}