File tree Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -80,13 +80,22 @@ pickle functions from the :mod:`copyreg` module.
8080   single: __deepcopy__() (copy protocol)
8181
8282In order for a class to define its own copy implementation, it can define
83- special methods :meth: `__copy__ ` and :meth: `__deepcopy__ `.  The former is called
84- to implement the shallow copy operation; no additional arguments are passed.
85- The latter is called to implement the deep copy operation; it is passed one
86- argument, the ``memo `` dictionary.  If the :meth: `__deepcopy__ ` implementation needs
87- to make a deep copy of a component, it should call the :func: `deepcopy ` function
88- with the component as first argument and the memo dictionary as second argument.
89- The memo dictionary should be treated as an opaque object.
83+ special methods :meth: `~object.__copy__ ` and :meth: `~object.__deepcopy__ `.
84+ 
85+ .. method :: object.__copy__(self) 
86+    :noindexentry: 
87+ 
88+    Called to implement the shallow copy operation;
89+    no additional arguments are passed.
90+ 
91+ .. method :: object.__deepcopy__(self, memo) 
92+    :noindexentry: 
93+ 
94+    Called to implement the deep copy operation; it is passed one
95+    argument, the *memo * dictionary.  If the ``__deepcopy__ `` implementation needs
96+    to make a deep copy of a component, it should call the :func: `deepcopy ` function
97+    with the component as first argument and the *memo * dictionary as second argument.
98+    The *memo * dictionary should be treated as an opaque object.
9099
91100
92101.. seealso ::
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ Doc/library/asyncio-subprocess.rst
2222Doc/library/audioop.rst
2323Doc/library/cgi.rst
2424Doc/library/chunk.rst
25- Doc/library/copy.rst
2625Doc/library/decimal.rst
2726Doc/library/email.charset.rst
2827Doc/library/email.compat32-message.rst
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments