{
    "content": [
        {
            "type": "text",
            "text": "# _contextvars (pydoc)\n\n**Summary:** contextvars - Context Variables\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **MODULE REFERENCE** (8 lines)\n- **CLASSES** (5 lines) — 3 subsections\n  - class Context (68 lines)\n  - class ContextVar (51 lines)\n  - class Token (34 lines)\n- **FUNCTIONS** (1 lines) — 1 subsections\n  - copy_context (1 lines)\n- **FILE** (3 lines)\n\n## Full Content\n\n### NAME\n\ncontextvars - Context Variables\n\n### MODULE REFERENCE\n\nhttps://docs.python.org/3.10/library/contextvars.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### CLASSES\n\nbuiltins.object\nContext\nContextVar\nToken\n\n#### class Context\n\n|  Methods defined here:\n|\n|  contains(self, key, /)\n|      Return key in self.\n|\n|  eq(self, value, /)\n|      Return self==value.\n|\n|  ge(self, value, /)\n|      Return self>=value.\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  getitem(self, key, /)\n|      Return self[key].\n|\n|  gt(self, value, /)\n|      Return self>value.\n|\n|  iter(self, /)\n|      Implement iter(self).\n|\n|  le(self, value, /)\n|      Return self<=value.\n|\n|  len(self, /)\n|      Return len(self).\n|\n|  lt(self, value, /)\n|      Return self<value.\n|\n|  ne(self, value, /)\n|      Return self!=value.\n|\n|  copy(self, /)\n|      Return a shallow copy of the context object.\n|\n|  get(self, key, default=None, /)\n|      Return the value for `key` if `key` has the value in the context object.\n|\n|      If `key` does not exist, return `default`. If `default` is not given,\n|      return None.\n|\n|  items(self, /)\n|      Return all variables and their values in the context object.\n|\n|      The result is returned as a list of 2-tuples (variable, value).\n|\n|  keys(self, /)\n|      Return a list of all variables in the context object.\n|\n|  run(...)\n|\n|  values(self, /)\n|      Return a list of all variables' values in the context object.\n|\n|  ----------------------------------------------------------------------\n|  Static methods defined here:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes defined here:\n|\n|  hash = None\n\n#### class ContextVar\n\n|  Methods defined here:\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  hash(self, /)\n|      Return hash(self).\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  get(...)\n|      Return a value for the context variable for the current context.\n|\n|      If there is no value for the variable in the current context, the method will:\n|       * return the value of the default argument of the method, if provided; or\n|       * return the default value for the context variable, if it was created\n|         with one; or\n|       * raise a LookupError.\n|\n|  reset(self, token, /)\n|      Reset the context variable.\n|\n|      The variable is reset to the value it had before the `ContextVar.set()` that\n|      created the token was used.\n|\n|  set(self, value, /)\n|      Call to set a new value for the context variable in the current context.\n|\n|      The required value argument is the new value for the context variable.\n|\n|      Returns a Token object that can be used to restore the variable to its previous\n|      value via the `ContextVar.reset()` method.\n|\n|  ----------------------------------------------------------------------\n|  Class methods defined here:\n|\n|  classgetitem(...) from builtins.type\n|      See PEP 585\n|\n|  ----------------------------------------------------------------------\n|  Static methods defined here:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  name\n\n#### class Token\n\n|  Methods defined here:\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  ----------------------------------------------------------------------\n|  Class methods defined here:\n|\n|  classgetitem(...) from builtins.type\n|      See PEP 585\n|\n|  ----------------------------------------------------------------------\n|  Static methods defined here:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  oldvalue\n|\n|  var\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes defined here:\n|\n|  MISSING = <Token.MISSING>\n|\n|  hash = None\n\n### FUNCTIONS\n\n#### copy_context\n\n### FILE\n\n/usr/lib/python3.10/lib-dynload/contextvars.cpython-310-x8664-linux-gnu.so\n\n"
        }
    ],
    "structuredContent": {
        "command": "_contextvars",
        "section": "",
        "mode": "pydoc",
        "summary": "contextvars - Context Variables",
        "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": "CLASSES",
                "lines": 5,
                "subsections": [
                    {
                        "name": "class Context",
                        "lines": 68
                    },
                    {
                        "name": "class ContextVar",
                        "lines": 51
                    },
                    {
                        "name": "class Token",
                        "lines": 34
                    }
                ]
            },
            {
                "name": "FUNCTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "copy_context",
                        "lines": 1
                    }
                ]
            },
            {
                "name": "FILE",
                "lines": 3,
                "subsections": []
            }
        ]
    }
}