Kaydet (Commit) ffdde9e9 authored tarafından Georg Brandl's avatar Georg Brandl

Properly document copy and deepcopy as functions.

üst 93ed8204
:mod:`copy` --- Shallow and deep copy operations :mod:`copy` --- Shallow and deep copy operations
================================================ ================================================
.. module:: copy .. module:: copy
:synopsis: Shallow and deep copy operations. :synopsis: Shallow and deep copy operations.
This module provides generic (shallow and deep) copying operations.
.. index::
single: copy() (in copy)
single: deepcopy() (in copy)
This module provides generic (shallow and deep) copying operations. Interface summary:
.. function:: copy(x)
Return a shallow copy of *x*.
.. function:: deepcopy(x)
Return a deep copy of *x*.
Interface summary::
import copy .. exception:: error
x = copy.copy(y) # make a shallow copy of y Raised for module specific errors.
x = copy.deepcopy(y) # make a deep copy of y
For module specific errors, :exc:`copy.error` is raised.
The difference between shallow and deep copying is only relevant for compound The difference between shallow and deep copying is only relevant for compound
objects (objects that contain other objects, like lists or class instances): objects (objects that contain other objects, like lists or class instances):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment