{
    "content": [
        {
            "type": "text",
            "text": "# codeop (pydoc)\n\n**Summary:** codeop - Utilities to compile possibly incomplete Python source code.\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **MODULE REFERENCE** (8 lines)\n- **DESCRIPTION** (12 lines) — 1 subsections\n  - compile_command (17 lines)\n- **CLASSES** (4 lines) — 2 subsections\n  - class CommandCompiler (39 lines)\n  - class Compile (22 lines)\n- **FUNCTIONS** (1 lines) — 1 subsections\n  - compile_command (18 lines)\n- **DATA** (2 lines)\n- **FILE** (3 lines)\n\n## Full Content\n\n### NAME\n\ncodeop - Utilities to compile possibly incomplete Python source code.\n\n### MODULE REFERENCE\n\nhttps://docs.python.org/3.10/library/codeop.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\n### DESCRIPTION\n\nThis module provides two interfaces, broadly similar to the builtin\nfunction compile(), which take program text, a filename and a 'mode'\nand:\n\n- Return code object if the command is complete and valid\n- Return None if the command is incomplete\n- Raise SyntaxError, ValueError or OverflowError if the command is a\nsyntax error (OverflowError and ValueError can be produced by\nmalformed literals).\n\nThe two interfaces are:\n\n#### compile_command\n\nCompiles a single command in the manner described above.\n\nCommandCompiler():\n\nInstances of this class have call methods identical in\nsignature to compilecommand; the difference is that if the\ninstance compiles program text containing a future statement,\nthe instance 'remembers' and compiles all subsequent program texts\nwith the statement in force.\n\nThe module also provides another class:\n\nCompile():\n\nInstances of this class act like the built-in function compile,\nbut with 'memory' in the sense described above.\n\n### CLASSES\n\nbuiltins.object\nCommandCompiler\nCompile\n\n#### class CommandCompiler\n\n|  Instances of this class have call methods identical in\n|  signature to compilecommand; the difference is that if the\n|  instance compiles program text containing a future statement,\n|  the instance 'remembers' and compiles all subsequent program texts\n|  with the statement in force.\n|\n|  Methods defined here:\n|\n|  call(self, source, filename='<input>', symbol='single')\n|      Compile a command and determine whether it is incomplete.\n|\n|      Arguments:\n|\n|      source -- the source string; may contain \\n characters\n|      filename -- optional filename from which source was read;\n|                  default \"<input>\"\n|      symbol -- optional grammar start symbol; \"single\" (default) or\n|                \"eval\"\n|\n|      Return value / exceptions raised:\n|\n|      - Return a code object if the command is complete and valid\n|      - Return None if the command is incomplete\n|      - Raise SyntaxError, ValueError or OverflowError if the command is a\n|        syntax error (OverflowError and ValueError can be produced by\n|        malformed literals).\n|\n|  init(self)\n|      Initialize self.  See help(type(self)) for accurate signature.\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\n#### class Compile\n\n|  Instances of this class behave much like the built-in compile\n|  function, but if one is used to compile text containing a future\n|  statement, it \"remembers\" and compiles all subsequent program texts\n|  with the statement in force.\n|\n|  Methods defined here:\n|\n|  call(self, source, filename, symbol)\n|      Call self as a function.\n|\n|  init(self)\n|      Initialize self.  See help(type(self)) for accurate signature.\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\n### FUNCTIONS\n\n#### compile_command\n\nCompile a command and determine whether it is incomplete.\n\nArguments:\n\nsource -- the source string; may contain \\n characters\nfilename -- optional filename from which source was read; default\n\"<input>\"\nsymbol -- optional grammar start symbol; \"single\" (default), \"exec\"\nor \"eval\"\n\nReturn value / exceptions raised:\n\n- Return a code object if the command is complete and valid\n- Return None if the command is incomplete\n- Raise SyntaxError, ValueError or OverflowError if the command is a\nsyntax error (OverflowError and ValueError can be produced by\nmalformed literals).\n\n### DATA\n\nall = ['compilecommand', 'Compile', 'CommandCompiler']\n\n### FILE\n\n/usr/lib/python3.10/codeop.py\n\n"
        }
    ],
    "structuredContent": {
        "command": "codeop",
        "section": "",
        "mode": "pydoc",
        "summary": "codeop - Utilities to compile possibly incomplete Python source code.",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "MODULE REFERENCE",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 12,
                "subsections": [
                    {
                        "name": "compile_command",
                        "lines": 17
                    }
                ]
            },
            {
                "name": "CLASSES",
                "lines": 4,
                "subsections": [
                    {
                        "name": "class CommandCompiler",
                        "lines": 39
                    },
                    {
                        "name": "class Compile",
                        "lines": 22
                    }
                ]
            },
            {
                "name": "FUNCTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "compile_command",
                        "lines": 18
                    }
                ]
            },
            {
                "name": "DATA",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "FILE",
                "lines": 3,
                "subsections": []
            }
        ]
    }
}