
    dafj                         d Z ddlZddlZddlZddlZddlmZmZmZm	Z	m
Z
mZ ddlZddlmZ eeee	fZe
efZeez   Z G d dej$                        Zd Zedk(  r ej,                          yy)	zUnit tests for the copy module.    N)leltgegteqne)supportc                      e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z!d  Z"d! Z#d" Z$d# Z%d$ Z&d% Z'd& Z(d' Z)d( Z*d) Z+d* Z,d+ Z-d, Z.d- Z/d. Z0d/ Z1d0 Z2d1 Z3d2 Z4d3 Z5d4 Z6d5 Z7d6 Z8d7 Z9d8 Z:d9 Z;d: Z<d; Z=d< Z>d= Z?d> Z@d? ZAd@ ZBdA ZCdB ZDdC ZEdD ZFdE ZGdF ZHdG ZIdH ZJdI ZKdJ ZLdK ZMdL ZNdM ZOdN ZPyO)PTestCopyc                     | j                  t        j                  t        j                         | j	                  t        t        j                  t                     y N)assertIscopyErrorerror
assertTrue
issubclass	Exceptionselfs    )/root/Python-3.12.4/Lib/test/test_copy.pytest_exceptionszTestCopy.test_exceptions   s/    djj$**-
4::y9:    c                 V    d}t        j                   |      }| j                  ||       y N*   )r   assertEqualr   xys      r   test_copy_basiczTestCopy.test_copy_basic   s$    IIaLAr   c                      G fddt                d      }t        j                  |      }| j                  |j                  |j                         | j                  |j                  |j                         y )Nc                       e Zd Zd Z fdZy)"TestCopy.test_copy_copy.<locals>.Cc                     || _         y r   foor   r'   s     r   __init__z+TestCopy.test_copy_copy.<locals>.C.__init__!   	    r   c                 (     | j                         S r   r&   r   Cs    r   __copy__z+TestCopy.test_copy_copy.<locals>.C.__copy__#       {"r   N)__name__
__module____qualname__r)   r.   r-   s   r   r-   r$       s    #r   r-   r   )objectr   r   	__class__r'   r   r   r    r-   s      @r   test_copy_copyzTestCopy.test_copy_copy   sW    	# 	#
 bEIIaLakk2&r   c                     G d dt               fd} d      }| j                  t        t        j                  |       t	        j
                  |       t        j                  |      }| j                  ||       | j                  t        |             | j                  |j                  |j                         y )Nc                       e Zd Zd Zy)&TestCopy.test_copy_registry.<locals>.Cc                 >    t         j                  |       }||_        |S r   r4   __new__r'   clsr'   objs      r   r=   z.TestCopy.test_copy_registry.<locals>.C.__new__,       nnS)
r   Nr0   r1   r2   r=    r   r   r-   r:   +       r   r-   c                 "    | j                   ffS r   r&   r@   r-   s    r   pickle_Cz-TestCopy.test_copy_registry.<locals>.pickle_C0       z?"r   r   )
r4   assertRaises	TypeErrorr   copyregpickleassertIsNotr   typer'   r   rG   r   r    r-   s       @r   test_copy_registryzTestCopy.test_copy_registry*   s    	 	
	#bE)TYY2q(A&IIaLAa!$&r   c                      G fddt               }g  |       }t        j                  |      }| j                  ||       | j                  dg       y )Nc                       e Zd Z fdZd Zy)'TestCopy.test_copy_reduce_ex.<locals>.Cc                 (    j                  d       yN    appendr   protocs     r   __reduce_ex__z5TestCopy.test_copy_reduce_ex.<locals>.C.__reduce_ex__<       r   c                 &    | j                  d       y Nzshouldn't call thisfailr   s    r   
__reduce__z2TestCopy.test_copy_reduce_ex.<locals>.C.__reduce__?       		/0r   Nr0   r1   r2   r]   rc   r\   s   r   r-   rS   ;       1r   r-   rV   r4   r   r   r   r   r-   r   r    r\   s       @r   test_copy_reduce_exzTestCopy.test_copy_reduce_ex:   sJ    	1 	1 CIIaLaQC r   c                      G fddt               }g  |       }t        j                  |      }| j                  ||       | j                  dg       y )Nc                       e Zd Z fdZy)$TestCopy.test_copy_reduce.<locals>.Cc                 (    j                  d       yrU   rX   r   r\   s    r   rc   z/TestCopy.test_copy_reduce.<locals>.C.__reduce__I   r^   r   Nr0   r1   r2   rc   rf   s   r   r-   rm   H       r   r-   rV   rh   ri   s       @r   test_copy_reducezTestCopy.test_copy_reduceG   sJ    	 	 CIIaLaQC r   c                      G d dt               } |       }| j                  t        j                  t        j                  |       y )Nc                       e Zd Zd Zy)"TestCopy.test_copy_cant.<locals>.Cc                 f    |j                  d      rt        |      t        j                  | |      S N__reduce
startswithAttributeErrorr4   __getattribute__r   names     r   r|   z3TestCopy.test_copy_cant.<locals>.C.__getattribute__T   ,    ??:.(....tT::r   Nr0   r1   r2   r|   rC   r   r   r-   ru   S       ;r   r-   )r4   rI   r   r   r   r-   r   s      r   test_copy_cantzTestCopy.test_copy_cantR   s1    	; 	;
 C$**dii3r   c                 \    G d d      }d } G d dt         j                        }d dt        dd	d
z  dddddd|j                  dt	        t        d            t        d      t        ddd	      |t        |t               g}|D ]'  }| j                  t        j                  |      |       ) y )Nc                       e Zd Zy)+TestCopy.test_copy_atomic.<locals>.NewStyleNr0   r1   r2   rC   r   r   NewStyler   ^       r   r   c                       y r   rC   rC   r   r   fz$TestCopy.test_copy_atomic.<locals>.f`       r   c                       e Zd Zy)0TestCopy.test_copy_atomic.<locals>.WithMetaclassNr   rC   r   r   WithMetaclassr   b   r   r   r   	metaclass.r      d   Q	@TF              ?hello   helloሴs   world   
   rV   )abcABCMetaNotImplemented__code__bytesrangeslicemaxpropertyr   r   )r   r   r   r   testsr   s         r   test_copy_atomiczTestCopy.test_copy_atomic]   s    	 			ckk 	sNQVT4-5s,eBiq"a3xz	;
  	+AMM$))A,*	+r   c                     g d}t        j                   |      }| j                  ||       | j                  ||       g }t        j                   |      }| j                  ||       | j                  ||       y )NrV   r      r   r   rM   r   s      r   test_copy_listzTestCopy.test_copy_listl   sf    IIaLAAIIaLAAr   c                     d}| j                  t        j                  |      |       d}| j                  t        j                  |      |       dddg f}| j                  t        j                  |      |       y )Nr   rC   rV   r   r   )r   r   r   r   s     r   test_copy_tuplezTestCopy.test_copy_tuplev   s[    diilA&diilA&1bMdiilA&r   c                     ddd}t        j                   |      }| j                  ||       | j                  ||       i }t        j                   |      }| j                  ||       | j                  ||       y )NrV   r   r'   barr   r   s      r   test_copy_dictzTestCopy.test_copy_dict~   sk    a IIaLAAIIaLAAr   c                    h d}t        j                   |      }| j                  ||       | j                  ||       t               }t        j                   |      }| j                  ||       | j                  ||       y N>   rV   r   r   )r   r   rM   setr   s      r   test_copy_setzTestCopy.test_copy_set   sh    IIaLAAEIIaLAAr   c                     t        h d      }| j                  t        j                  |      |       t               }| j                  t        j                  |      |       y r   )	frozensetr   r   r   s     r   test_copy_frozensetzTestCopy.test_copy_frozenset   s?    i diilA&KdiilA&r   c                    t        d      }t        j                  |      }| j                  ||       | j                  ||       t               }t        j                  |      }| j                  ||       | j                  ||       y )Ns   abc)	bytearrayr   r   rM   r   s      r   test_copy_bytearrayzTestCopy.test_copy_bytearray   sm    fIIaLAAKIIaLAAr   c                 r     G d d      } |d      }| j                  t        j                  |      |       y )Nc                       e Zd Zd Zd Zy)*TestCopy.test_copy_inst_vanilla.<locals>.Cc                     || _         y r   r&   r(   s     r   r)   z3TestCopy.test_copy_inst_vanilla.<locals>.C.__init__   r*   r   c                 4    | j                   |j                   k(  S r   r&   r   others     r   __eq__z1TestCopy.test_copy_inst_vanilla.<locals>.C.__eq__       xx599,,r   Nr0   r1   r2   r)   r   rC   r   r   r-   r          -r   r-   r   r   r   r   s      r   test_copy_inst_vanillazTestCopy.test_copy_inst_vanilla   s/    	- 	-
 bE1q)r   c                 x     G fdd       d      }| j                  t        j                  |      |       y )Nc                   $    e Zd Zd Z fdZd Zy)'TestCopy.test_copy_inst_copy.<locals>.Cc                     || _         y r   r&   r(   s     r   r)   z0TestCopy.test_copy_inst_copy.<locals>.C.__init__   r*   r   c                 (     | j                         S r   r&   r,   s    r   r.   z0TestCopy.test_copy_inst_copy.<locals>.C.__copy__   r/   r   c                 4    | j                   |j                   k(  S r   r&   r   s     r   r   z.TestCopy.test_copy_inst_copy.<locals>.C.__eq__   r   r   N)r0   r1   r2   r)   r.   r   r3   s   r   r-   r      s    #-r   r-   r   r   r   r   r-   s     @r   test_copy_inst_copyzTestCopy.test_copy_inst_copy   s0    	- 	- bE1q)r   c                 r     G d d      } |d      }| j                  t        j                  |      |       y )Nc                       e Zd Zd Zd Zd Zy).TestCopy.test_copy_inst_getinitargs.<locals>.Cc                     || _         y r   r&   r(   s     r   r)   z7TestCopy.test_copy_inst_getinitargs.<locals>.C.__init__   r*   r   c                     | j                   fS r   r&   r   s    r   __getinitargs__z>TestCopy.test_copy_inst_getinitargs.<locals>.C.__getinitargs__       {"r   c                 4    | j                   |j                   k(  S r   r&   r   s     r   r   z5TestCopy.test_copy_inst_getinitargs.<locals>.C.__eq__   r   r   Nr0   r1   r2   r)   r   r   rC   r   r   r-   r          #-r   r-   r   r   r   s      r   test_copy_inst_getinitargsz#TestCopy.test_copy_inst_getinitargs   /    	- 	- bE1q)r   c                     G d dt               } |d      }t        j                  |      }| j                  ||       | j                  ||       | j	                  ||       | j                  |j
                  |j
                         y )Nc                       e Zd Zd Zd Zd Zy)-TestCopy.test_copy_inst_getnewargs.<locals>.Cc                 >    t         j                  |       }||_        |S r   intr=   r'   r?   r'   r   s      r   r=   z5TestCopy.test_copy_inst_getnewargs.<locals>.C.__new__       {{3'r   c                     | j                   fS r   r&   r   s    r   __getnewargs__z<TestCopy.test_copy_inst_getnewargs.<locals>.C.__getnewargs__       xxy r   c                 4    | j                   |j                   k(  S r   r&   r   s     r   r   z4TestCopy.test_copy_inst_getnewargs.<locals>.C.__eq__   r   r   Nr0   r1   r2   r=   r   r   rC   r   r   r-   r          !-r   r-   r   r   r   assertIsInstancer   rM   r'   r   r-   r   r    s       r   test_copy_inst_getnewargsz"TestCopy.test_copy_inst_getnewargs   sn    	- 	- bEIIaLa#AA&r   c                     G d dt               } |d      }t        j                  |      }| j                  ||       | j                  ||       | j	                  ||       | j                  |j
                  |j
                         y )Nc                       e Zd Zd Zd Zd Zy)0TestCopy.test_copy_inst_getnewargs_ex.<locals>.Cc                >    t         j                  |       }||_        |S r   r   r   s      r   r=   z8TestCopy.test_copy_inst_getnewargs_ex.<locals>.C.__new__   r   r   c                 "    dd| j                   ifS NrC   r'   r&   r   s    r   __getnewargs_ex__zBTestCopy.test_copy_inst_getnewargs_ex.<locals>.C.__getnewargs_ex__       E488,,,r   c                 4    | j                   |j                   k(  S r   r&   r   s     r   r   z7TestCopy.test_copy_inst_getnewargs_ex.<locals>.C.__eq__   r   r   Nr0   r1   r2   r=   r   r   rC   r   r   r-   r          --r   r-   r   r&   r   r   s       r   test_copy_inst_getnewargs_exz%TestCopy.test_copy_inst_getnewargs_ex   sn    	- 	- "IIIaLa#AA&r   c                 r     G d d      } |d      }| j                  t        j                  |      |       y )Nc                       e Zd Zd Zd Zd Zy)+TestCopy.test_copy_inst_getstate.<locals>.Cc                     || _         y r   r&   r(   s     r   r)   z4TestCopy.test_copy_inst_getstate.<locals>.C.__init__   r*   r   c                     d| j                   iS Nr'   r&   r   s    r   __getstate__z8TestCopy.test_copy_inst_getstate.<locals>.C.__getstate__       txx((r   c                 4    | j                   |j                   k(  S r   r&   r   s     r   r   z2TestCopy.test_copy_inst_getstate.<locals>.C.__eq__   r   r   Nr0   r1   r2   r)   r   r   rC   r   r   r-   r          )-r   r-   r   r   r   s      r   test_copy_inst_getstatez TestCopy.test_copy_inst_getstate   r   r   c                 r     G d d      } |d      }| j                  t        j                  |      |       y )Nc                       e Zd Zd Zd Zd Zy)+TestCopy.test_copy_inst_setstate.<locals>.Cc                     || _         y r   r&   r(   s     r   r)   z4TestCopy.test_copy_inst_setstate.<locals>.C.__init__   r*   r   c                     |d   | _         y r   r&   r   states     r   __setstate__z8TestCopy.test_copy_inst_setstate.<locals>.C.__setstate__        <r   c                 4    | j                   |j                   k(  S r   r&   r   s     r   r   z2TestCopy.test_copy_inst_setstate.<locals>.C.__eq__   r   r   Nr0   r1   r2   r)   r  r   rC   r   r   r-   r         (-r   r-   r   r   r   s      r   test_copy_inst_setstatez TestCopy.test_copy_inst_setstate   r   r   c                      G d d      } |d      }| j                  t        j                  |      |        |d      }| j                  t        j                  |      |       y )Nc                   $    e Zd Zd Zd Zd Zd Zy)4TestCopy.test_copy_inst_getstate_setstate.<locals>.Cc                     || _         y r   r&   r(   s     r   r)   z=TestCopy.test_copy_inst_getstate_setstate.<locals>.C.__init__   r*   r   c                     | j                   S r   r&   r   s    r   r   zATestCopy.test_copy_inst_getstate_setstate.<locals>.C.__getstate__       xxr   c                     || _         y r   r&   r  s     r   r  zATestCopy.test_copy_inst_getstate_setstate.<locals>.C.__setstate__   	     r   c                 4    | j                   |j                   k(  S r   r&   r   s     r   r   z;TestCopy.test_copy_inst_getstate_setstate.<locals>.C.__eq__  r   r   Nr0   r1   r2   r)   r   r  r   rC   r   r   r-   r          !-r   r-   r   g        r   r   s      r    test_copy_inst_getstate_setstatez)TestCopy.test_copy_inst_getstate_setstate   sP    	- 	- bE1q)cF1q)r   c                 V    d}t        j                  |      }| j                  ||       y r   )r   deepcopyr   r   s      r   test_deepcopy_basiczTestCopy.test_deepcopy_basic  s%    MM!Ar   c                     g }||g}t        j                  |      }| j                  ||       | j                  ||       | j                  |d   |d          | j	                  |d   |d          y Nr   rV   )r   r   r   rM   r   r   s      r   test_deepcopy_memozTestCopy.test_deepcopy_memo  sn     FMM!AA1qt$adAaD!r   c                      G d dt               } G d d|      }| j                  t        j                  |      |       y )Nc                       e Zd Zy)/TestCopy.test_deepcopy_issubclass.<locals>.MetaNr   rC   r   r   Metar'     r   r   r(  c                       e Zd Zy),TestCopy.test_deepcopy_issubclass.<locals>.CNr   rC   r   r   r-   r*  "  r   r   r-   r   )rN   r   r   r   )r   r(  r-   s      r   test_deepcopy_issubclassz!TestCopy.test_deepcopy_issubclass  s3    
	4 		$ 	q)1-r   c                      G fddt                d      }t        j                  |      }| j                  |j                  |j                         | j                  |j
                  |j
                         y )Nc                        e Zd Zd Zd fd	Zy)*TestCopy.test_deepcopy_deepcopy.<locals>.Cc                     || _         y r   r&   r(   s     r   r)   z3TestCopy.test_deepcopy_deepcopy.<locals>.C.__init__(  r*   r   Nc                 (     | j                         S r   r&   r   memor-   s     r   __deepcopy__z7TestCopy.test_deepcopy_deepcopy.<locals>.C.__deepcopy__*  r/   r   r   )r0   r1   r2   r)   r3  r3   s   r   r-   r.  '  s    #r   r-   r   )r4   r   r   r   r5   r'   r6   s      @r   test_deepcopy_deepcopyzTestCopy.test_deepcopy_deepcopy&  sX    	# 	#
 bEMM!akk2&r   c                     G d dt               fd} d      }| j                  t        t        j                  |       t        j                  |       t        j                  |      }| j                  ||       | j                  t        |             | j                  |j                  |j                         y )Nc                       e Zd Zd Zy)*TestCopy.test_deepcopy_registry.<locals>.Cc                 >    t         j                  |       }||_        |S r   r<   r>   s      r   r=   z2TestCopy.test_deepcopy_registry.<locals>.C.__new__3  rA   r   NrB   rC   r   r   r-   r7  2  rD   r   r-   c                 "    | j                   ffS r   r&   rF   s    r   rG   z1TestCopy.test_deepcopy_registry.<locals>.pickle_C7  rH   r   r   )r4   rI   rJ   r   r   rK   rL   rM   r   rN   r'   rO   s       @r   test_deepcopy_registryzTestCopy.test_deepcopy_registry1  s    	 	
	#bE)T]]A6q(A&MM!Aa!$&r   c                      G fddt               }g  |       }t        j                  |      }| j                  ||       | j	                  dg       y )Nc                       e Zd Z fdZd Zy)+TestCopy.test_deepcopy_reduce_ex.<locals>.Cc                 (    j                  d       yrU   rX   rZ   s     r   r]   z9TestCopy.test_deepcopy_reduce_ex.<locals>.C.__reduce_ex__C  r^   r   c                 &    | j                  d       y r`   ra   r   s    r   rc   z6TestCopy.test_deepcopy_reduce_ex.<locals>.C.__reduce__F  rd   r   Nre   rf   s   r   r-   r=  B  rg   r   r-   rV   r4   r   r   r   r   ri   s       @r   test_deepcopy_reduce_exz TestCopy.test_deepcopy_reduce_exA  sK    	1 	1 CMM!aQC r   c                      G fddt               }g  |       }t        j                  |      }| j                  ||       | j	                  dg       y )Nc                       e Zd Z fdZy)(TestCopy.test_deepcopy_reduce.<locals>.Cc                 (    j                  d       yrU   rX   ro   s    r   rc   z3TestCopy.test_deepcopy_reduce.<locals>.C.__reduce__P  r^   r   Nrp   rf   s   r   r-   rD  O  rq   r   r-   rV   r@  ri   s       @r   test_deepcopy_reducezTestCopy.test_deepcopy_reduceN  sK    	 	 CMM!aQC r   c                      G d dt               } |       }| j                  t        j                  t        j                  |       y )Nc                       e Zd Zd Zy)&TestCopy.test_deepcopy_cant.<locals>.Cc                 f    |j                  d      rt        |      t        j                  | |      S rw   ry   r}   s     r   r|   z7TestCopy.test_deepcopy_cant.<locals>.C.__getattribute__[  r   r   Nr   rC   r   r   r-   rI  Z  r   r   r-   )r4   rI   r   r   r   r   s      r   test_deepcopy_cantzTestCopy.test_deepcopy_cantY  s1    	; 	;
 C$**dmmQ7r   c                      G d d      }d }d dt         dddz  dd	d
dddd|j                  |t        d      t        t	               g}|D ]'  }| j                  t        j                  |      |       ) y )Nc                       e Zd Zy)/TestCopy.test_deepcopy_atomic.<locals>.NewStyleNr   rC   r   r   r   rN  e  r   r   r   c                       y r   rC   rC   r   r   r   z(TestCopy.test_deepcopy_atomic.<locals>.fg  r   r   .r   r   r   r   TFr   s   bytesr   r   r   )r   r   r   r   r   r   r   r   )r   r   r   r   r   s        r   test_deepcopy_atomiczTestCopy.test_deepcopy_atomicd  ss    	 		sNB3dE27M1::59c8:7  	/AMM$--*A.	/r   c                     ddgdg}t        j                  |      }| j                  ||       | j                  ||       | j                  |d   |d          y NrV   r   r   r   r   r   r   rM   r   s      r   test_deepcopy_listzTestCopy.test_deepcopy_listo  U    VQKMM!AA1qt$r   c                    g }|j                  |       t        j                  |      }t        D ]  }| j	                  t
        |||        | j                  ||       | j                  |d   |       | j                  t        |      d       y r#  )
rY   r   r   comparisonsrI   RecursionErrorrM   r   r   lenr   r   r    ops       r   test_deepcopy_reflexive_listz%TestCopy.test_deepcopy_reflexive_listv  sy    	MM! 	8Bnb!Q7	8AadAQ#r   c                 V    d}t        j                  |      }| j                  ||       y NrC   r   r   r   r   s      r   test_deepcopy_empty_tuplez"TestCopy.test_deepcopy_empty_tuple  s#    MM!ar   c                     ddgdf}t        j                  |      }| j                  ||       | j                  ||       | j                  |d   |d          y rR  rS  r   s      r   test_deepcopy_tuplezTestCopy.test_deepcopy_tuple  rU  r   c                 V    d}t        j                  |      }| j                  ||       y )N)rV   r   r   r_  r   s      r   !test_deepcopy_tuple_of_immutablesz*TestCopy.test_deepcopy_tuple_of_immutables  s#    MM!ar   c                 &   g f}|d   j                  |       t        j                  |      }t        D ]  }| j	                  t
        |||        | j                  ||       | j                  |d   |d          | j                  |d   d   |       y Nr   )rY   r   r   rW  rI   rX  rM   r   rZ  s       r   test_deepcopy_reflexive_tuplez&TestCopy.test_deepcopy_reflexive_tuple  s    E	!AMM! 	8Bnb!Q7	8A1qt$ad1gq!r   c                     ddgdd}t        j                  |      }| j                  ||       | j                  ||       | j                  |d   |d          y )NrV   r   r   r   r'   rS  r   s      r   test_deepcopy_dictzTestCopy.test_deepcopy_dict  sV    F1%MM!AA51U8,r   c                 L   i }||d<   t        j                  |      }t        D ]  }| j                  t        |||        t
        D ]  }| j                  t        |||        | j                  ||       | j                  |d   |       | j                  t        |      d       y )Nr'   rV   )r   r   order_comparisonsrI   rJ   equality_comparisonsrX  rM   r   r   rY  rZ  s       r   test_deepcopy_reflexive_dictz%TestCopy.test_deepcopy_reflexive_dict  s    %MM!# 	3BiQ2	3& 	8Bnb!Q7	8Aah"Q#r   c                 z    i }g }t        j                  ||      }| j                  |t        |         d   |       y rg  )r   r   r   idr   r2  r   r    s       r   test_deepcopy_keepalivez TestCopy.test_deepcopy_keepalive  s7    MM!T"d2d8nQ'+r   c                 &   i }g d}t        j                  ||      }| j                  ||       | j                  t        |      d       i }dg}t        j                  ||      }| j                  ||       | j                  t        |      d       y )N)rV   r   r      r   rd  )r   r   r   rY  rq  s       r   !test_deepcopy_dont_memo_immutablez*TestCopy.test_deepcopy_dont_memo_immutable  s    MM!T"ATA&HMM!T"ATA&r   c                      G d d      } |dg      }t        j                  |      }| j                  ||       | j                  |j                  |j                         y )Nc                       e Zd Zd Zd Zy).TestCopy.test_deepcopy_inst_vanilla.<locals>.Cc                     || _         y r   r&   r(   s     r   r)   z7TestCopy.test_deepcopy_inst_vanilla.<locals>.C.__init__  r*   r   c                 4    | j                   |j                   k(  S r   r&   r   s     r   r   z5TestCopy.test_deepcopy_inst_vanilla.<locals>.C.__eq__  r   r   Nr   rC   r   r   r-   rx    r   r   r-   r   r   r   r   rM   r'   r   s       r   test_deepcopy_inst_vanillaz#TestCopy.test_deepcopy_inst_vanilla  sO    	- 	-
 rdGMM!A&r   c                      G fdd       dg      }t        j                  |      }| j                  ||       | j                  ||       | j                  |j                  |j                         y )Nc                   $    e Zd Zd Z fdZd Zy)/TestCopy.test_deepcopy_inst_deepcopy.<locals>.Cc                     || _         y r   r&   r(   s     r   r)   z8TestCopy.test_deepcopy_inst_deepcopy.<locals>.C.__init__  r*   r   c                 P     t        j                  | j                  |            S r   )r   r   r'   r1  s     r   r3  z<TestCopy.test_deepcopy_inst_deepcopy.<locals>.C.__deepcopy__  s    txx677r   c                 4    | j                   |j                   k(  S r   r&   r   s     r   r   z6TestCopy.test_deepcopy_inst_deepcopy.<locals>.C.__eq__  r   r   N)r0   r1   r2   r)   r3  r   r3   s   r   r-   r    s    8-r   r-   r   r{  r6   s      @r   test_deepcopy_inst_deepcopyz$TestCopy.test_deepcopy_inst_deepcopy  s`    	- 	- rdGMM!AA&r   c                      G d d      } |dg      }t        j                  |      }| j                  ||       | j                  ||       | j                  |j                  |j                         y )Nc                       e Zd Zd Zd Zd Zy)2TestCopy.test_deepcopy_inst_getinitargs.<locals>.Cc                     || _         y r   r&   r(   s     r   r)   z;TestCopy.test_deepcopy_inst_getinitargs.<locals>.C.__init__  r*   r   c                     | j                   fS r   r&   r   s    r   r   zBTestCopy.test_deepcopy_inst_getinitargs.<locals>.C.__getinitargs__  r   r   c                 4    | j                   |j                   k(  S r   r&   r   s     r   r   z9TestCopy.test_deepcopy_inst_getinitargs.<locals>.C.__eq__  r   r   Nr   rC   r   r   r-   r    r   r   r-   r   r{  r   s       r   test_deepcopy_inst_getinitargsz'TestCopy.test_deepcopy_inst_getinitargs  _    	- 	- rdGMM!AA&r   c                 b    G d dt               } |dg      }t        j                  |      }| j                  ||       | j	                  ||       | j                  ||       | j	                  |j                  |j                         | j                  |j                  |j                         y )Nc                       e Zd Zd Zd Zd Zy)1TestCopy.test_deepcopy_inst_getnewargs.<locals>.Cc                 >    t         j                  |       }||_        |S r   r   r   s      r   r=   z9TestCopy.test_deepcopy_inst_getnewargs.<locals>.C.__new__  r   r   c                     | j                   fS r   r&   r   s    r   r   z@TestCopy.test_deepcopy_inst_getnewargs.<locals>.C.__getnewargs__  r   r   c                 4    | j                   |j                   k(  S r   r&   r   s     r   r   z8TestCopy.test_deepcopy_inst_getnewargs.<locals>.C.__eq__  r   r   Nr   rC   r   r   r-   r    r   r   r-   r   r   r   r   r   r   rM   r'   r   s       r   test_deepcopy_inst_getnewargsz&TestCopy.test_deepcopy_inst_getnewargs  s    	- 	- rdGMM!a#AA&&r   c                 d    G d dt               } |dg      }t        j                  |      }| j                  ||       | j	                  ||       | j                  ||       | j	                  |j                  |j                         | j                  |j                  |j                         y )Nc                       e Zd Zd Zd Zd Zy)4TestCopy.test_deepcopy_inst_getnewargs_ex.<locals>.Cc                >    t         j                  |       }||_        |S r   r   r   s      r   r=   z<TestCopy.test_deepcopy_inst_getnewargs_ex.<locals>.C.__new__  r   r   c                 "    dd| j                   ifS r   r&   r   s    r   r   zFTestCopy.test_deepcopy_inst_getnewargs_ex.<locals>.C.__getnewargs_ex__  r   r   c                 4    | j                   |j                   k(  S r   r&   r   s     r   r   z;TestCopy.test_deepcopy_inst_getnewargs_ex.<locals>.C.__eq__  r   r   Nr   rC   r   r   r-   r    r   r   r-   r   r&   r  r   s       r    test_deepcopy_inst_getnewargs_exz)TestCopy.test_deepcopy_inst_getnewargs_ex  s    	- 	- 2$KMM!a#AA&&r   c                      G d d      } |dg      }t        j                  |      }| j                  ||       | j                  ||       | j                  |j                  |j                         y )Nc                       e Zd Zd Zd Zd Zy)/TestCopy.test_deepcopy_inst_getstate.<locals>.Cc                     || _         y r   r&   r(   s     r   r)   z8TestCopy.test_deepcopy_inst_getstate.<locals>.C.__init__  r*   r   c                     d| j                   iS r   r&   r   s    r   r   z<TestCopy.test_deepcopy_inst_getstate.<locals>.C.__getstate__  r  r   c                 4    | j                   |j                   k(  S r   r&   r   s     r   r   z6TestCopy.test_deepcopy_inst_getstate.<locals>.C.__eq__  r   r   Nr  rC   r   r   r-   r    r  r   r-   r   r{  r   s       r   test_deepcopy_inst_getstatez$TestCopy.test_deepcopy_inst_getstate  r  r   c                      G d d      } |dg      }t        j                  |      }| j                  ||       | j                  ||       | j                  |j                  |j                         y )Nc                       e Zd Zd Zd Zd Zy)/TestCopy.test_deepcopy_inst_setstate.<locals>.Cc                     || _         y r   r&   r(   s     r   r)   z8TestCopy.test_deepcopy_inst_setstate.<locals>.C.__init__  r*   r   c                     |d   | _         y r   r&   r  s     r   r  z<TestCopy.test_deepcopy_inst_setstate.<locals>.C.__setstate__   r  r   c                 4    | j                   |j                   k(  S r   r&   r   s     r   r   z6TestCopy.test_deepcopy_inst_setstate.<locals>.C.__eq__"  r   r   Nr  rC   r   r   r-   r    r  r   r-   r   r{  r   s       r   test_deepcopy_inst_setstatez$TestCopy.test_deepcopy_inst_setstate  r  r   c                     G d d      } |dg      }t        j                  |      }| j                  ||       | j                  ||       | j                  |j                  |j                          |g       }t        j                  |      }| j                  ||       | j                  ||       | j                  |j                  |j                         y )Nc                   $    e Zd Zd Zd Zd Zd Zy)8TestCopy.test_deepcopy_inst_getstate_setstate.<locals>.Cc                     || _         y r   r&   r(   s     r   r)   zATestCopy.test_deepcopy_inst_getstate_setstate.<locals>.C.__init__,  r*   r   c                     | j                   S r   r&   r   s    r   r   zETestCopy.test_deepcopy_inst_getstate_setstate.<locals>.C.__getstate__.  r  r   c                     || _         y r   r&   r  s     r   r  zETestCopy.test_deepcopy_inst_getstate_setstate.<locals>.C.__setstate__0  r  r   c                 4    | j                   |j                   k(  S r   r&   r   s     r   r   z?TestCopy.test_deepcopy_inst_getstate_setstate.<locals>.C.__eq__2  r   r   Nr  rC   r   r   r-   r  +  r  r   r-   r   r{  r   s       r   $test_deepcopy_inst_getstate_setstatez-TestCopy.test_deepcopy_inst_getstate_setstate*  s    	- 	- rdGMM!AA&bEMM!AA&r   c                      G d d      } |       }||_         t        j                  |      }| j                  ||       | j	                  |j                   |       y )Nc                       e Zd Zy)0TestCopy.test_deepcopy_reflexive_inst.<locals>.CNr   rC   r   r   r-   r  A  r   r   r-   )r'   r   r   rM   r   r   s       r   test_deepcopy_reflexive_instz%TestCopy.test_deepcopy_reflexive_inst@  sJ    	 	CMM!AaeeQr   c                      G d dt               } |       }t        j                  |      }| j                  ||       t        j                  |      }| j                  ||       y )Nc                       e Zd Zd Zy)+TestCopy.test_reconstruct_string.<locals>.Cc                      y)NrW   rC   r   s    r   rc   z6TestCopy.test_reconstruct_string.<locals>.C.__reduce__M  s    r   Nrp   rC   r   r   r-   r  L  s    r   r-   )r4   r   r   r   r   s       r   test_reconstruct_stringz TestCopy.test_reconstruct_stringK  sN    	 	 CIIaLaMM!ar   c                 0    G fddt                       }d|_        t        j                  |      }| j                  |j                  |j                         t        j
                  |      }| j                  |j                  |j                         y )Nc                       e Zd Z fdZy),TestCopy.test_reconstruct_nostate.<locals>.Cc                     dfS r^  rC   r,   s    r   rc   z7TestCopy.test_reconstruct_nostate.<locals>.C.__reduce__W  s    2wr   Nrp   r3   s   r   r-   r  V  s    r   r-   r   )r4   r'   r   r   r5   r   r6   s      @r   test_reconstruct_nostatez!TestCopy.test_reconstruct_nostateU  sf    	 	 CIIaLakk1;;/MM!akk1;;/r   c                 .    G fddt                       }dg|_        t        j                  |      }| j                  ||       t        j                  |      }| j                  ||       | j                  |j                  |j                         y )Nc                       e Zd Z fdZd Zy)*TestCopy.test_reconstruct_state.<locals>.Cc                 "    d| j                   fS r^  __dict__r,   s    r   rc   z5TestCopy.test_reconstruct_state.<locals>.C.__reduce__b      2t}}--r   c                 4    | j                   |j                   k(  S r   r  r   s     r   r   z1TestCopy.test_reconstruct_state.<locals>.C.__eq__d      }}66r   Nr0   r1   r2   rc   r   r3   s   r   r-   r  a  s    .7r   r-   r   r4   r'   r   r   r   rM   r6   s      @r   test_reconstruct_statezTestCopy.test_reconstruct_state`  st    	7 	7
 CIIaLAMM!A&r   c                 .    G fddt                       }dg|_        t        j                  |      }| j                  ||       t        j                  |      }| j                  ||       | j                  |j                  |j                         y )Nc                   $    e Zd Z fdZd Zd Zy)3TestCopy.test_reconstruct_state_setstate.<locals>.Cc                 "    d| j                   fS r^  r  r,   s    r   rc   z>TestCopy.test_reconstruct_state_setstate.<locals>.C.__reduce__p  r  r   c                 :    | j                   j                  |       y r   )r  updater  s     r   r  z@TestCopy.test_reconstruct_state_setstate.<locals>.C.__setstate__r  s    $$U+r   c                 4    | j                   |j                   k(  S r   r  r   s     r   r   z:TestCopy.test_reconstruct_state_setstate.<locals>.C.__eq__t  r  r   N)r0   r1   r2   rc   r  r   r3   s   r   r-   r  o  s    .,7r   r-   r   r  r6   s      @r   test_reconstruct_state_setstatez(TestCopy.test_reconstruct_state_setstaten  st    	7 	7 CIIaLAMM!A&r   c                      G d dt               } |       }||_        t        j                  |      }| j	                  ||       | j                  |j                  |       y )Nc                       e Zd Zy).TestCopy.test_reconstruct_reflexive.<locals>.CNr   rC   r   r   r-   r    r   r   r-   )r4   r'   r   r   rM   r   r   s       r   test_reconstruct_reflexivez#TestCopy.test_reconstruct_reflexive~  sL    	 	CMM!AaeeQr   c                     G fddt                ddgdg      }t        j                  |      }| j                  ||       | j                  ||       | j	                  |d   |d          t        j
                  |      }| j                  ||       | j                  ||       | j                  |d   |d          y )Nc                       e Zd Z fdZd Zy)&TestCopy.test_reduce_4tuple.<locals>.Cc                 6    d| j                   t        |       fS r^  )r  iterr,   s    r   rc   z1TestCopy.test_reduce_4tuple.<locals>.C.__reduce__  s    2t}}d4j99r   c                 f    t        |       t        |      k(  xr | j                  |j                  k(  S r   )listr  r   s     r   r   z-TestCopy.test_reduce_4tuple.<locals>.C.__eq__  ,    T
d5k1 879r   Nr  r3   s   r   r-   r    s    :9r   r-   rV   r   r   r   )r  r   r   rM   r   r   r6   s      @r   test_reduce_4tuplezTestCopy.test_reduce_4tuple  s    	9 	9 1vqkNIIaLAAadAaD!MM!AA1qt$r   c                     G fddt                dddgfdg      }t        j                  |      }| j                  ||       | j                  ||       | j	                  |d   |d          t        j
                  |      }| j                  ||       | j                  ||       | j                  |d   |d          y )Nc                       e Zd Z fdZd Zy)&TestCopy.test_reduce_5tuple.<locals>.Cc                 B    d| j                   d | j                         fS r^  )r  itemsr,   s    r   rc   z1TestCopy.test_reduce_5tuple.<locals>.C.__reduce__  s    2t}}dDJJLAAr   c                 f    t        |       t        |      k(  xr | j                  |j                  k(  S r   )dictr  r   s     r   r   z-TestCopy.test_reduce_5tuple.<locals>.C.__eq__  r  r   Nr  r3   s   r   r-   r    s    B9r   r-   r'   rV   r   )r   r   )r  r   r   rM   r   r   r6   s      @r   test_reduce_5tuplezTestCopy.test_reduce_5tuple  s    	9 	9 1v
+,IIaLAAah%)MM!AA51U8,r   c                 8     fd G fdd              } j                  t              5  t        j                  |       d d d         j                  t              5  t        j                  |       d d d        y # 1 sw Y   =xY w# 1 sw Y   y xY w)Nc                  (    j                  d       y r`   ra   )argskwargsr   s     r   state_setterz1TestCopy.test_reduce_6tuple.<locals>.state_setter  s    II+,r   c                       e Zd Z fdZy)&TestCopy.test_reduce_6tuple.<locals>.Cc                 (    d| j                   d d fS r^  r  )r   r-   r  s    r   rc   z1TestCopy.test_reduce_6tuple.<locals>.C.__reduce__  s    "dmmT4EEr   Nrp   )r-   r  s   r   r-   r    s	    Fr   r-   rI   rJ   r   r   )r   r   r-   r  s   ` @@r   test_reduce_6tuplezTestCopy.test_reduce_6tuple  s    	-	F 	F Cy) 	IIaL	y) 	MM!	 		 		 	s   B%BBBc                 (    G fdd              }| j                  t              5  t        j                  |       d d d        | j                  t              5  t        j                  |       d d d        y # 1 sw Y   =xY w# 1 sw Y   y xY w)Nc                       e Zd Z fdZy)+TestCopy.test_reduce_6tuple_none.<locals>.Cc                 (    d| j                   d d d fS r^  r  r,   s    r   rc   z6TestCopy.test_reduce_6tuple_none.<locals>.C.__reduce__  s    "dmmT4==r   Nrp   r3   s   r   r-   r    s    >r   r-   r  r   s     @r   test_reduce_6tuple_nonez TestCopy.test_reduce_6tuple_none  sx    	> 	> Cy) 	IIaL	y) 	MM!	 		 		 	s   A<B<BBc                      G d dt               } |       }dg|_        t        j                  |      }| j                  |j                  |j                         y )Nc                       e Zd ZdgZy)#TestCopy.test_copy_slots.<locals>.Cr'   Nr0   r1   r2   	__slots__rC   r   r   r-   r    	    Ir   r-   r   )r4   r'   r   r   r   s       r   test_copy_slotszTestCopy.test_copy_slots  sA    	  	 CIIaLaeeQUU#r   c                     G d dt               } |       }dg|_        t        j                  |      }| j	                  |j                  |j                         | j                  |j                  |j                         y )Nc                       e Zd ZdgZy)'TestCopy.test_deepcopy_slots.<locals>.Cr'   Nr  rC   r   r   r-   r     r  r   r-   r   )r4   r'   r   r   r   rM   r   s       r   test_deepcopy_slotszTestCopy.test_deepcopy_slots  s\    	  	 CMM!&&r   c                 p    G d dt               } |ddi      }t        j                  |      }| j                  ||       | j                  |j                  |j                         | j                  ||       d|d<   | j                  ||       | j                  |j                  |j                         y )Nc                   *     e Zd Zd fd	Z fdZ xZS )/TestCopy.test_deepcopy_dict_subclass.<locals>.Cc                 h    |si }t        |j                               | _        t        |   |       y r   )r  keys_keyssuperr)   )r   dr5   s     r   r)   z8TestCopy.test_deepcopy_dict_subclass.<locals>.C.__init__  s)    A!!&&(^
 #r   c                 z    t         |   ||       || j                  vr| j                  j                  |       y y r   )r  __setitem__r  rY   )r   keyitemr5   s      r   r  z;TestCopy.test_deepcopy_dict_subclass.<locals>.C.__setitem__  s5    #C.djj(JJ%%c* )r   r   )r0   r1   r2   r)   r  __classcell__)r5   s   @r   r-   r    s    $
+ +r   r-   r'   r   )r	  rV   r   )r  r   r   r   r  rM   assertNotEqualr   s       r   test_deepcopy_dict_subclassz$TestCopy.test_deepcopy_dict_subclass  s    		+ 		+ q	NMM!A!''*A%Aq!AGGQWW-r   c                     G d dt               } |ddgdg      }ddg|_        t        j                  |      }| j                  t        |      t        |             | j                  |j                  |j                         | j	                  |d   |d          | j	                  |j                  |j                         y )	Nc                       e Zd Zy)+TestCopy.test_copy_list_subclass.<locals>.CNr   rC   r   r   r-   r    r   r   r-   rV   r   r   rt     r   )r  r'   r   r   r   r   s       r   test_copy_list_subclassz TestCopy.test_copy_list_subclass  s    	 	1vqkNAIIaLa$q'*&adAaD!aeeQUU#r   c                     G d dt               } |ddgdg      }ddg|_        t        j                  |      }| j	                  t        |      t        |             | j	                  |j                  |j                         | j                  |d   |d          | j                  |j                  |j                         y )	Nc                       e Zd Zy)/TestCopy.test_deepcopy_list_subclass.<locals>.CNr   rC   r   r   r-   r    r   r   r-   rV   r   r   rt  r  r   )r  r'   r   r   r   rM   r   s       r   test_deepcopy_list_subclassz$TestCopy.test_deepcopy_list_subclass  s    	 	1vqkNAMM!a$q'*&1qt$&r   c                      G d dt               } |g d      }| j                  t        |      d       t        j                  |      }| j                  t        |      d       y )Nc                       e Zd Zy),TestCopy.test_copy_tuple_subclass.<locals>.CNr   rC   r   r   r-   r    r   r   r-   r   )tupler   r   r   s       r   test_copy_tuple_subclassz!TestCopy.test_copy_tuple_subclass  sL    	 	iLq9-IIaLq9-r   c                 4    G d dt               } |ddgdg      }| j                  t        |      ddgdf       t        j                  |      }| j                  t        |      ddgdf       | j	                  ||       | j	                  |d   |d          y )Nc                       e Zd Zy)0TestCopy.test_deepcopy_tuple_subclass.<locals>.CNr   rC   r   r   r-   r!    r   r   r-   rV   r   r   r   )r  r   r   r   rM   r   s       r   test_deepcopy_tuple_subclassz%TestCopy.test_deepcopy_tuple_subclass  s    	 	1vqkNqQFA;/MM!qQFA;/A1qt$r   c                 v     G d dt               }| j                  t        t        j                   |              y )Nc                       e Zd Zd Zy)-TestCopy.test_getstate_exc.<locals>.EvilStatec                     t        d      )Nzain't got no stickin' state)
ValueErrorr   s    r   r   z:TestCopy.test_getstate_exc.<locals>.EvilState.__getstate__  s     !>??r   N)r0   r1   r2   r   rC   r   r   	EvilStater%    s    @r   r(  )r4   rI   r'  r   )r   r(  s     r   test_getstate_exczTestCopy.test_getstate_exc  s*    	@ 	@ 	*dii=r   c                     | j                  t        j                  t              t               d }| j                  t        j                  |      |       d }| j                  t        j                  |      |       y )Nc                     | |z   S r   rC   r   r    s     r   r'   z(TestCopy.test_copy_function.<locals>.foo  
    aczr   c                       y r   rC   rC   r   r   <lambda>z-TestCopy.test_copy_function.<locals>.<lambda>      r   )r   r   
global_foor   r'   r   s      r   test_copy_functionzTestCopy.test_copy_function  sS    :.
;!3-3-r   c                     | j                  t        j                  t              t               d }| j                  t        j                  |      |       d }| j                  t        j                  |      |       y )Nc                     | |z   S r   rC   r,  s     r   r'   z,TestCopy.test_deepcopy_function.<locals>.foo  r-  r   c                       y r   rC   rC   r   r   r/  z1TestCopy.test_deepcopy_function.<locals>.<lambda>  r0  r   )r   r   r   r1  r2  s      r   test_deepcopy_functionzTestCopy.test_deepcopy_function  sU    z2J?!s+S1s+S1r   c                      G d dt               } |       }t        j                  |      } ||      }| j                  ||       ~ ||      }| j                  ||       y )Nc                       e Zd Zy)"TestCopy._check_weakref.<locals>.CNr   rC   r   r   r-   r:  #  r   r   r-   )r4   weakrefrefr   )r   _copyr-   r@   r   r    s         r   _check_weakrefzTestCopy._check_weakref"  sT    	 	cKK!Ha!Har   c                 B    | j                  t        j                         y r   )r>  r   r   s    r   test_copy_weakrefzTestCopy.test_copy_weakref-  s    DII&r   c                 B    | j                  t        j                         y r   )r>  r   r   r   s    r   test_deepcopy_weakrefzTestCopy.test_deepcopy_weakref0  s    DMM*r   c                 <    G d dt               }t        d      D cg c]	  } |        c}\  }}}} |       }|||<   |||<   t        j                  |      }	| j                  |	|       | j	                  |	|       | j	                  |	|   |       | j	                  |	|   |       | j	                  t        |	      d       ~~t        j                          | j	                  t        |	      d        |        |       }}
||	|
<   | j                  |
|       y c c}w )Nc                       e Zd Zy)(TestCopy._check_copy_weakdict.<locals>.CNr   rC   r   r   r-   rE  4  r   r   r-   rt  r   rV   )	r4   r   r   rM   r   rY  r	   
gc_collectassertNotIn)r   	_dicttyper-   iabr\   r	  uvr   r    s               r   _check_copy_weakdictzTestCopy._check_copy_weakdict3  s    	 	#(8,aac,
1aK!!IIaLAA1q!1q!Q#qQ#sAC1!A! -s   Dc                 B    | j                  t        j                         y r   )rN  r;  WeakKeyDictionaryr   s    r   test_copy_weakkeydictzTestCopy.test_copy_weakkeydictH  s    !!'";";<r   c                 B    | j                  t        j                         y r   )rN  r;  WeakValueDictionaryr   s    r   test_copy_weakvaluedictz TestCopy.test_copy_weakvaluedictK  s    !!'"="=>r   c                     G d dt               }t        d      D cg c]
  } ||       c}\  }}}}t        j                         }|||<   |||<   t	        j
                  |      }| j                  ||       | j                  t        |      d       | j                  ||   |       | j                  ||   |       | j                  ||   j                  |j                         | j                  ||   j                  |j                         ~t        j                          | j                  t        |      d       y c c}w )Nc                       e Zd Zd Zy)-TestCopy.test_deepcopy_weakkeydict.<locals>.Cc                     || _         y r   rI  r   rI  s     r   r)   z6TestCopy.test_deepcopy_weakkeydict.<locals>.C.__init__P  	    r   Nr0   r1   r2   r)   rC   r   r   r-   rW  O      r   r-   rt  r   rV   )r4   r   r;  rP  r   r   r  r   rY  rM   rI  r	   rF  )	r   r-   rI  rJ  rK  r\   r	  rL  rM  s	            r   test_deepcopy_weakkeydictz"TestCopy.test_deepcopy_weakkeydictN  s
   	 	 %*!H-qad-
1a%%'!!MM!Aq!Q#1q!1q!1%1%Q# .s   Ec                     G d dt               }t        d      D cg c]
  } ||       c}\  }}}}t        j                         }|||<   |||<   t	        j
                  |      }| j                  ||       | j                  t        |      d       t        |j                         d       \  \  }	}
\  }}| j                  |	|       | j                  |	j                  |j                         | j                  |
|       | j                  ||       | j                  |j                  |j                         | j                  ||       ~	~
~~~t        j                          | j                  t        |      d       y c c}w )Nc                       e Zd Zd Zy)/TestCopy.test_deepcopy_weakvaluedict.<locals>.Cc                     || _         y r   rY  rZ  s     r   r)   z8TestCopy.test_deepcopy_weakvaluedict.<locals>.C.__init__d  r[  r   Nr\  rC   r   r   r-   ra  c  r]  r   r-   rt  r   c                      | d   j                   S rg  rY  )pairs    r   r/  z6TestCopy.test_deepcopy_weakvaluedict.<locals>.<lambda>n  s    DGII r   )r  rV   )r4   r   r;  rS  r   r   r  r   rY  sortedr  rM   rI  r   r	   rF  )r   r-   rI  rJ  rK  r\   r	  rL  rM  r   r    zts                r   test_deepcopy_weakvaluedictz$TestCopy.test_deepcopy_weakvaluedictb  s>   	 	 %*!H-qad-
1a'')!!MM!Aq!Q#	/EFAAAacc"aAacc"aq!QQ#% .s   Fc                 4    G d dt               } |       }|j                  |_        t        j                  |      }| j                  |j                  |j                         | j                  |j                  j                  |       |j                          y )Nc                       e Zd Zd Zy)0TestCopy.test_deepcopy_bound_method.<locals>.Fooc                      y r   rC   r   s    r   mz2TestCopy.test_deepcopy_bound_method.<locals>.Foo.m|  s    r   N)r0   r1   r2   rm  rC   r   r   Foork  {  s    r   rn  )r4   rm  rK  r   r   r   r   __self__)r   rn  r   gs       r   test_deepcopy_bound_methodz#TestCopy.test_deepcopy_bound_methodz  sg    	& 	 EccMM!acc"accllA&	r   N)Qr0   r1   r2   r   r!   r7   rP   rj   rr   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r!  r$  r+  r4  r:  rA  rF  rK  rP  rT  r\  r`  rb  re  rh  rj  rn  rr  ru  r|  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r"  r)  r3  r7  r>  r@  rB  rN  rQ  rT  r^  rh  rq  rC   r   r   r   r      s   ;
	'' !	!4+''*	*	*'"'"	*	**$
	"	.	'' !	!8	/%$
%
"-
$,'	''''$'$''', 	0''  %"-"
$'.(	$	'.%>.2	'+*=?$($0	r   r   c                     | |z   S r   rC   r,  s     r   r1  r1    s
    QqSjr   __main__)__doc__r   rK   r;  r   operatorr   r   r   r   r   r   unittesttestr	   rl  rm  rW  TestCaser   r1  r0   mainrC   r   r   <module>rz     su    %    
 + +  BN 2v "66sx   sl !zHMMO r   