{
    "content": [
        {
            "type": "text",
            "text": "# copy (pydoc)\n\n**Summary:** copy - Generic (shallow and deep) copying operations.\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **MODULE REFERENCE** (8 lines)\n- **DESCRIPTION** (47 lines)\n- **CLASSES** (3 lines) — 1 subsections\n  - class Error (67 lines)\n- **FUNCTIONS** (1 lines) — 2 subsections\n  - copy (4 lines)\n  - deepcopy (4 lines)\n- **DATA** (2 lines)\n- **FILE** (3 lines)\n\n## Full Content\n\n### NAME\n\ncopy - Generic (shallow and deep) copying operations.\n\n### MODULE REFERENCE\n\nhttps://docs.python.org/3.10/library/copy.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\nInterface summary:\n\nimport copy\n\nx = copy.copy(y)        # make a shallow copy of y\nx = copy.deepcopy(y)    # make a deep copy of y\n\nFor module specific errors, copy.Error is raised.\n\nThe difference between shallow and deep copying is only relevant for\ncompound objects (objects that contain other objects, like lists or\nclass instances).\n\n- A shallow copy constructs a new compound object and then (to the\nextent possible) inserts *the same objects* into it that the\noriginal contains.\n\n- A deep copy constructs a new compound object and then, recursively,\ninserts *copies* into it of the objects found in the original.\n\nTwo problems often exist with deep copy operations that don't exist\nwith shallow copy operations:\n\na) recursive objects (compound objects that, directly or indirectly,\ncontain a reference to themselves) may cause a recursive loop\n\nb) because deep copy copies *everything* it may copy too much, e.g.\nadministrative data structures that should be shared even between\ncopies\n\nPython's deep copy operation avoids these problems by:\n\na) keeping a table of objects already copied during the current\ncopying pass\n\nb) letting user-defined classes override the copying operation or the\nset of components copied\n\nThis version does not copy types like module, class, function, method,\nnor stack trace, stack frame, nor file, socket, window, nor any\nsimilar types.\n\nClasses can use the same interfaces to control copying that they use\nto control pickling: they can define methods called getinitargs(),\ngetstate() and setstate().  See the documentation for module\n\"pickle\" for information on these methods.\n\n### CLASSES\n\nbuiltins.Exception(builtins.BaseException)\nError\n\n#### class Error\n\n|  Method resolution order:\n|      Error\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors defined here:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n### FUNCTIONS\n\n#### copy\n\nShallow copy operation on arbitrary Python objects.\n\nSee the module's doc string for more info.\n\n#### deepcopy\n\nDeep copy operation on arbitrary Python objects.\n\nSee the module's doc string for more info.\n\n### DATA\n\nall = ['Error', 'copy', 'deepcopy']\n\n### FILE\n\n/usr/lib/python3.10/copy.py\n\n"
        }
    ],
    "structuredContent": {
        "command": "copy",
        "section": "",
        "mode": "pydoc",
        "summary": "copy - Generic (shallow and deep) copying operations.",
        "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": 47,
                "subsections": []
            },
            {
                "name": "CLASSES",
                "lines": 3,
                "subsections": [
                    {
                        "name": "class Error",
                        "lines": 67
                    }
                ]
            },
            {
                "name": "FUNCTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "copy",
                        "lines": 4
                    },
                    {
                        "name": "deepcopy",
                        "lines": 4
                    }
                ]
            },
            {
                "name": "DATA",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "FILE",
                "lines": 3,
                "subsections": []
            }
        ]
    }
}