HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/test/__pycache__/test_copy.cpython-310.opt-2.pyc
o

�i�j�@s�	ddlZddlZddlZddlZddlmZmZmZmZm	Z	m
Z
ddlZddlm
Z
eeeefZe	e
fZeeZGdd�dej�Zdd�ZedkrPe��dSdS)	�N)�le�lt�ge�gt�eq�ne)�supportc@s|eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dEdF�Z%dGdH�Z&dIdJ�Z'dKdL�Z(dMdN�Z)dOdP�Z*dQdR�Z+dSdT�Z,dUdV�Z-dWdX�Z.dYdZ�Z/d[d\�Z0d]d^�Z1d_d`�Z2dadb�Z3dcdd�Z4dedf�Z5dgdh�Z6didj�Z7dkdl�Z8dmdn�Z9dodp�Z:dqdr�Z;dsdt�Z<dudv�Z=dwdx�Z>dydz�Z?d{d|�Z@d}d~�ZAdd��ZBd�d��ZCd�d��ZDd�d��ZEd�d��ZFd�d��ZGd�d��ZHd�d��ZId�d��ZJd�d��ZKd�d��ZLd�d��ZMd�d��ZNd�d��ZOd�d��ZPd�S)��TestCopycCs&|�tjtj�|�ttjt��dS�N)�assertIs�copy�Error�errorZ
assertTrue�
issubclass�	Exception��self�r�+/usr/local/lib/python3.10/test/test_copy.py�test_exceptionsszTestCopy.test_exceptionscCsd}t�|�}|�||�dS�N�*)r�assertEqual�r�x�yrrr�test_copy_basic�
zTestCopy.test_copy_basiccsJG�fdd�dt���d�}t�|�}|�|j|j�|�|j|j�dS)Ncs eZdZdd�Z�fdd�ZdS)z"TestCopy.test_copy_copy.<locals>.CcS�
||_dSr
��foo�rr rrr�__init__!�
z+TestCopy.test_copy_copy.<locals>.C.__init__c�
�|j�Sr
rr��Crr�__copy__#r#z+TestCopy.test_copy_copy.<locals>.C.__copy__N)�__name__�
__module__�__qualname__r"r'rr%rrr& sr&r)�objectrr�	__class__r rrr%r�test_copy_copy�

zTestCopy.test_copy_copycs|Gdd�dt���fdd�}�d�}|�ttj|�t��|��t�|�}|�||�|�t|���|�|j	|j	�dS)Nc@�eZdZdd�ZdS)z&TestCopy.test_copy_registry.<locals>.CcS�t�|�}||_|Sr
�r+�__new__r ��clsr �objrrrr2,�
z.TestCopy.test_copy_registry.<locals>.C.__new__N�r(r)r*r2rrrrr&+�r&c��|jffSr
r�r5r%rr�pickle_C0�z-TestCopy.test_copy_registry.<locals>.pickle_Cr)
r+�assertRaises�	TypeErrorr�copyreg�pickle�assertIsNotr�typer �rr;rrrr%r�test_copy_registry*�
zTestCopy.test_copy_registryc�FG�fdd�dt�}g�|�}t�|�}|�||�|��dg�dS)Nc� eZdZ�fdd�Zdd�ZdS)z'TestCopy.test_copy_reduce_ex.<locals>.Cc���d�dS�N����append�r�proto��crr�
__reduce_ex__<�
z5TestCopy.test_copy_reduce_ex.<locals>.C.__reduce_ex__cS�|�d�dS�Nzshouldn't call this�Zfailrrrr�
__reduce__?�z2TestCopy.test_copy_reduce_ex.<locals>.C.__reduce__N�r(r)r*rRrWrrPrrr&;�r&rJ�r+rrr�rr&rrrrPr�test_copy_reduce_ex:�
zTestCopy.test_copy_reduce_excrF)Nc�eZdZ�fdd�ZdS)z$TestCopy.test_copy_reduce.<locals>.CcrHrIrLrrPrrrWIrSz/TestCopy.test_copy_reduce.<locals>.C.__reduce__N�r(r)r*rWrrPrrr&H�r&rJr[r\rrPr�test_copy_reduceG�
zTestCopy.test_copy_reducecCs,Gdd�dt�}|�}|�tjtj|�dS)Nc@r/)z"TestCopy.test_copy_cant.<locals>.CcS�|�d�r	t|��t�||�S�NZ__reduce��
startswith�AttributeErrorr+�__getattribute__�r�namerrrriT�
z3TestCopy.test_copy_cant.<locals>.C.__getattribute__N�r(r)r*rirrrrr&Sr8r&)r+r=rr
�rr&rrrr�test_copy_cantR�zTestCopy.test_copy_cantcCs�Gdd�d�}Gdd�dt�}dd�}Gdd�dtjd	�}dd
tddd
dddddd|jdttd��td�tddd�||t|t	�g}|D]}|�
t�|�|�qDdS)Nc@�eZdZdS)z*TestCopy.test_copy_atomic.<locals>.ClassicN�r(r)r*rrrr�Classic^�rsc@rq)z+TestCopy.test_copy_atomic.<locals>.NewStyleNrrrrrr�NewStyle`rtrucS�dSr
rrrrr�fb�z$TestCopy.test_copy_atomic.<locals>.fc@rq)z0TestCopy.test_copy_atomic.<locals>.WithMetaclassNrrrrrr�
WithMetaclassdrtry��	metaclass.r��d���Q�	@TF��?�hello�helloሴsworld��
rJ)r+�abc�ABCMeta�NotImplemented�__code__�bytes�range�slice�max�propertyrr)rrsrurwry�testsrrrr�test_copy_atomic]s��zTestCopy.test_copy_atomiccCsTgd�}t�|�}|�||�|�||�g}t�|�}|�||�|�||�dS)N�rJr|��rrrArrrr�test_copy_listns

zTestCopy.test_copy_listcCsNd}|�t�|�|�d}|�t�|�|�dddgf}|�t�|�|�dS)Nr�rrJr|r�)rr�rrrrr�test_copy_tuplexszTestCopy.test_copy_tuplecCsVddd�}t�|�}|�||�|�||�i}t�|�}|�||�|�||�dS)NrJr|�r �barr�rrrr�test_copy_dict�s


zTestCopy.test_copy_dictcCsVhd�}t�|�}|�||�|�||�t�}t�|�}|�||�|�||�dS�N>rJr|r�)rrrA�setrrrr�
test_copy_set��

zTestCopy.test_copy_setcCs:thd��}|�t�|�|�t�}|�t�|�|�dSr�)�	frozensetrrr�rrr�test_copy_frozenset�szTestCopy.test_copy_frozensetcCsVtd�}t�|�}|�||�|�||�t�}t�|�}|�||�|�||�dS)Nsabc)�	bytearrayrrrArrrr�test_copy_bytearray�r�zTestCopy.test_copy_bytearraycC�,Gdd�d�}|d�}|�t�|�|�dS)Nc@�eZdZdd�Zdd�ZdS)z*TestCopy.test_copy_inst_vanilla.<locals>.CcSrr
rr!rrrr"�r#z3TestCopy.test_copy_inst_vanilla.<locals>.C.__init__cS�|j|jkSr
r�r�otherrrr�__eq__�r<z1TestCopy.test_copy_inst_vanilla.<locals>.C.__eq__N�r(r)r*r"r�rrrrr&��r&r�rrrnrrr�test_copy_inst_vanilla�szTestCopy.test_copy_inst_vanillacs0G�fdd�d���d�}|�t�|�|�dS)Nc�(eZdZdd�Z�fdd�Zdd�ZdS)z'TestCopy.test_copy_inst_copy.<locals>.CcSrr
rr!rrrr"�r#z0TestCopy.test_copy_inst_copy.<locals>.C.__init__cr$r
rrr%rrr'�r#z0TestCopy.test_copy_inst_copy.<locals>.C.__copy__cSr�r
rr�rrrr��r<z.TestCopy.test_copy_inst_copy.<locals>.C.__eq__N)r(r)r*r"r'r�rr%rrr&��r&rr�r�rr%r�test_copy_inst_copy�szTestCopy.test_copy_inst_copycCr�)Nc@�$eZdZdd�Zdd�Zdd�ZdS)z.TestCopy.test_copy_inst_getinitargs.<locals>.CcSrr
rr!rrrr"�r#z7TestCopy.test_copy_inst_getinitargs.<locals>.C.__init__cS�|jfSr
rrrrr�__getinitargs__��z>TestCopy.test_copy_inst_getinitargs.<locals>.C.__getinitargs__cSr�r
rr�rrrr��r<z5TestCopy.test_copy_inst_getinitargs.<locals>.C.__eq__N�r(r)r*r"r�r�rrrrr&��r&rr�rnrrr�test_copy_inst_getinitargs��z#TestCopy.test_copy_inst_getinitargscCsZGdd�dt�}|d�}t�|�}|�||�|�||�|�||�|�|j|j�dS)Nc@r�)z-TestCopy.test_copy_inst_getnewargs.<locals>.CcSr0r
��intr2r �r4r rrrrr2�r6z5TestCopy.test_copy_inst_getnewargs.<locals>.C.__new__cSr�r
rrrrr�__getnewargs__�r�z<TestCopy.test_copy_inst_getnewargs.<locals>.C.__getnewargs__cSr�r
rr�rrrr��r<z4TestCopy.test_copy_inst_getnewargs.<locals>.C.__eq__N�r(r)r*r2r�r�rrrrr&��r&r�r�r�assertIsInstancerrAr r\rrr�test_copy_inst_getnewargs�s	
z"TestCopy.test_copy_inst_getnewargscCs\Gdd�dt�}|dd�}t�|�}|�||�|�||�|�||�|�|j|j�dS)Nc@r�)z0TestCopy.test_copy_inst_getnewargs_ex.<locals>.CcSr0r
r�r�rrrr2�r6z8TestCopy.test_copy_inst_getnewargs_ex.<locals>.C.__new__cS�dd|jifS�Nrr rrrrr�__getnewargs_ex__�rXzBTestCopy.test_copy_inst_getnewargs_ex.<locals>.C.__getnewargs_ex__cSr�r
rr�rrrr��r<z7TestCopy.test_copy_inst_getnewargs_ex.<locals>.C.__eq__N�r(r)r*r2r�r�rrrrr&�r�r&rrr�r\rrr�test_copy_inst_getnewargs_ex�s
	
z%TestCopy.test_copy_inst_getnewargs_excCr�)Nc@r�)z+TestCopy.test_copy_inst_getstate.<locals>.CcSrr
rr!rrrr"�r#z4TestCopy.test_copy_inst_getstate.<locals>.C.__init__cS�
d|jiS�Nr rrrrr�__getstate__�r#z8TestCopy.test_copy_inst_getstate.<locals>.C.__getstate__cSr�r
rr�rrrr��r<z2TestCopy.test_copy_inst_getstate.<locals>.C.__eq__N�r(r)r*r"r�r�rrrrr&�r�r&rr�rnrrr�test_copy_inst_getstate�r�z TestCopy.test_copy_inst_getstatecCr�)Nc@r�)z+TestCopy.test_copy_inst_setstate.<locals>.CcSrr
rr!rrrr"�r#z4TestCopy.test_copy_inst_setstate.<locals>.C.__init__cS�|d|_dSr�r�r�staterrr�__setstate__�rXz8TestCopy.test_copy_inst_setstate.<locals>.C.__setstate__cSr�r
rr�rrrr��r<z2TestCopy.test_copy_inst_setstate.<locals>.C.__eq__N�r(r)r*r"r�r�rrrrr&�r�r&rr�rnrrr�test_copy_inst_setstate�r�z TestCopy.test_copy_inst_setstatecCsFGdd�d�}|d�}|�t�|�|�|d�}|�t�|�|�dS)Nc@�,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
z4TestCopy.test_copy_inst_getstate_setstate.<locals>.CcSrr
rr!rrrr"�r#z=TestCopy.test_copy_inst_getstate_setstate.<locals>.C.__init__cS�|jSr
rrrrrr���zATestCopy.test_copy_inst_getstate_setstate.<locals>.C.__getstate__cSrr
rr�rrrr�r#zATestCopy.test_copy_inst_getstate_setstate.<locals>.C.__setstate__cSr�r
rr�rrrr�r<z;TestCopy.test_copy_inst_getstate_setstate.<locals>.C.__eq__N�r(r)r*r"r�r�r�rrrrr&��
r&rgr�rnrrr� test_copy_inst_getstate_setstate�s
	z)TestCopy.test_copy_inst_getstate_setstatecCsd}t�|�}|�||�dSr)r�deepcopyrrrrr�test_deepcopy_basic
rzTestCopy.test_deepcopy_basiccCsZg}||g}t�|�}|�||�|�||�|�|d|d�|�|d|d�dS�NrrJ)rr�rrArrrrr�test_deepcopy_memos
zTestCopy.test_deepcopy_memocCs8Gdd�dt�}Gdd�d|d�}|�t�|�|�dS)Nc@rq)z/TestCopy.test_deepcopy_issubclass.<locals>.MetaNrrrrrr�Meta"rtr�c@rq)z,TestCopy.test_deepcopy_issubclass.<locals>.CNrrrrrrr&$rtr&rz)rBrrr�)rr�r&rrr�test_deepcopy_issubclasssz!TestCopy.test_deepcopy_issubclasscsJG�fdd�dt���d�}t�|�}|�|j|j�|�|j|j�dS)Ncs"eZdZdd�Zd�fdd�	ZdS)z*TestCopy.test_deepcopy_deepcopy.<locals>.CcSrr
rr!rrrr"*r#z3TestCopy.test_deepcopy_deepcopy.<locals>.C.__init__Ncr$r
r�r�memor%rr�__deepcopy__,r#z7TestCopy.test_deepcopy_deepcopy.<locals>.C.__deepcopy__r
)r(r)r*r"r�rr%rrr&)sr&r)r+rr�rr,r rrr%r�test_deepcopy_deepcopy(r.zTestCopy.test_deepcopy_deepcopycs|Gdd�dt���fdd�}�d�}|�ttj|�t��|��t�|�}|�||�|�t	|���|�|j
|j
�dS)Nc@r/)z*TestCopy.test_deepcopy_registry.<locals>.CcSr0r
r1r3rrrr25r6z2TestCopy.test_deepcopy_registry.<locals>.C.__new__Nr7rrrrr&4r8r&cr9r
rr:r%rrr;9r<z1TestCopy.test_deepcopy_registry.<locals>.pickle_Cr)r+r=r>rr�r?r@rArrBr rCrr%r�test_deepcopy_registry3rEzTestCopy.test_deepcopy_registryc�FG�fdd�dt�}g�|�}t�|�}|�||�|��dg�dS)NcrG)z+TestCopy.test_deepcopy_reduce_ex.<locals>.CcrHrIrLrNrPrrrRErSz9TestCopy.test_deepcopy_reduce_ex.<locals>.C.__reduce_ex__cSrTrUrVrrrrrWHrXz6TestCopy.test_deepcopy_reduce_ex.<locals>.C.__reduce__NrYrrPrrr&DrZr&rJ�r+rr�rrr\rrPr�test_deepcopy_reduce_exCr^z TestCopy.test_deepcopy_reduce_excr�)Ncr_)z(TestCopy.test_deepcopy_reduce.<locals>.CcrHrIrLrrPrrrWRrSz3TestCopy.test_deepcopy_reduce.<locals>.C.__reduce__Nr`rrPrrr&Qrar&rJr�r\rrPr�test_deepcopy_reducePrczTestCopy.test_deepcopy_reducecCs,Gdd�dt�}|�}|�tjtj|�dS)Nc@r/)z&TestCopy.test_deepcopy_cant.<locals>.CcSrdrerfrjrrrri]rlz7TestCopy.test_deepcopy_cant.<locals>.C.__getattribute__Nrmrrrrr&\r8r&)r+r=rr
r�rnrrr�test_deepcopy_cant[rpzTestCopy.test_deepcopy_cantcCszGdd�d�}Gdd�dt�}dd�}ddtdd	d
ddd
dddd|j|td�|tt�g}|D]}|�t�|�|�q/dS)Nc@rq)z.TestCopy.test_deepcopy_atomic.<locals>.ClassicNrrrrrrrsgrtrsc@rq)z/TestCopy.test_deepcopy_atomic.<locals>.NewStyleNrrrrrrruirtrucSrvr
rrrrrrwkrxz(TestCopy.test_deepcopy_atomic.<locals>.f.rr|r}r~TFrsbytesr�r�r�)	r+r�r�r�r�r�rrr�)rrsrurwr�rrrr�test_deepcopy_atomicfs
��zTestCopy.test_deepcopy_atomiccCsFddgdg}t�|�}|�||�|�||�|�|d|d�dS�NrJr|r�r�rr�rrArrrr�test_deepcopy_lists�

zTestCopy.test_deepcopy_listcCsbg}|�|�t�|�}tD]
}|�t|||�q|�||�|�|d|�|�t	|�d�dSr�)
rMrr��comparisonsr=�RecursionErrorrArr�len�rrr�oprrr�test_deepcopy_reflexive_listzs

z%TestCopy.test_deepcopy_reflexive_listcC�d}t�|�}|�||�dS�Nr�rr�rrrrr�test_deepcopy_empty_tuple�rz"TestCopy.test_deepcopy_empty_tuplecCsFddgdf}t�|�}|�||�|�||�|�|d|d�dSr�r�rrrr�test_deepcopy_tuple�r�zTestCopy.test_deepcopy_tuplecCr�)N)�rJr|r�r�rrrr�!test_deepcopy_tuple_of_immutables�rz*TestCopy.test_deepcopy_tuple_of_immutablescCspgf}|d�|�t�|�}tD]
}|�t|||�q|�||�|�|d|d�|�|dd|�dS�Nr)rMrr�r�r=r�rArr�rrr�test_deepcopy_reflexive_tuple�s
z&TestCopy.test_deepcopy_reflexive_tuplecCsHddgdd�}t�|�}|�||�|�||�|�|d|d�dS)NrJr|r�r�r r�rrrr�test_deepcopy_dict�s

zTestCopy.test_deepcopy_dictcCszi}||d<t�|�}tD]
}|�t|||�q
tD]
}|�t|||�q|�||�|�|d|�|�	t
|�d�dS)Nr rJ)rr��order_comparisonsr=r>�equality_comparisonsr�rArrr�r�rrr�test_deepcopy_reflexive_dict�s
z%TestCopy.test_deepcopy_reflexive_dictcCs0i}g}t�||�}|�|t|�d|�dSr�)rr�r�id�rr�rrrrr�test_deepcopy_keepalive�sz TestCopy.test_deepcopy_keepalivecCsji}gd�}t�||�}|�||�|�t|�d�i}dg}t�||�}|�||�|�t|�d�dS)N)rJr|r��r|r�)rr�rr�r�rrr�!test_deepcopy_dont_memo_immutable�sz*TestCopy.test_deepcopy_dont_memo_immutablecCsBGdd�d�}|dg�}t�|�}|�||�|�|j|j�dS)Nc@r�)z.TestCopy.test_deepcopy_inst_vanilla.<locals>.CcSrr
rr!rrrr"�r#z7TestCopy.test_deepcopy_inst_vanilla.<locals>.C.__init__cSr�r
rr�rrrr��r<z5TestCopy.test_deepcopy_inst_vanilla.<locals>.C.__eq__Nr�rrrrr&�r�r&r�rr�rrAr r\rrr�test_deepcopy_inst_vanilla�s


z#TestCopy.test_deepcopy_inst_vanillacsRG�fdd�d���dg�}t�|�}|�||�|�||�|�|j|j�dS)Ncr�)z/TestCopy.test_deepcopy_inst_deepcopy.<locals>.CcSrr
rr!rrrr"�r#z8TestCopy.test_deepcopy_inst_deepcopy.<locals>.C.__init__cs�t�|j|��Sr
)rr�r r�r%rrr���z<TestCopy.test_deepcopy_inst_deepcopy.<locals>.C.__deepcopy__cSr�r
rr�rrrr��r<z6TestCopy.test_deepcopy_inst_deepcopy.<locals>.C.__eq__N)r(r)r*r"r�r�rr%rrr&�r�r&rrrrr%r�test_deepcopy_inst_deepcopy�s

z$TestCopy.test_deepcopy_inst_deepcopycC�NGdd�d�}|dg�}t�|�}|�||�|�||�|�|j|j�dS)Nc@r�)z2TestCopy.test_deepcopy_inst_getinitargs.<locals>.CcSrr
rr!rrrr"�r#z;TestCopy.test_deepcopy_inst_getinitargs.<locals>.C.__init__cSr�r
rrrrrr��r�zBTestCopy.test_deepcopy_inst_getinitargs.<locals>.C.__getinitargs__cSr�r
rr�rrrr��r<z9TestCopy.test_deepcopy_inst_getinitargs.<locals>.C.__eq__Nr�rrrrr&�r�r&rrr\rrr�test_deepcopy_inst_getinitargs��

z'TestCopy.test_deepcopy_inst_getinitargscCslGdd�dt�}|dg�}t�|�}|�||�|�||�|�||�|�|j|j�|�|j|j�dS)Nc@r�)z1TestCopy.test_deepcopy_inst_getnewargs.<locals>.CcSr0r
r�r�rrrr2�r6z9TestCopy.test_deepcopy_inst_getnewargs.<locals>.C.__new__cSr�r
rrrrrr��r�z@TestCopy.test_deepcopy_inst_getnewargs.<locals>.C.__getnewargs__cSr�r
rr�rrrr��r<z8TestCopy.test_deepcopy_inst_getnewargs.<locals>.C.__eq__Nr�rrrrr&�r�r&r�r�rr�r�rrAr r\rrr�test_deepcopy_inst_getnewargs�s
	
z&TestCopy.test_deepcopy_inst_getnewargscCsnGdd�dt�}|dgd�}t�|�}|�||�|�||�|�||�|�|j|j�|�|j|j�dS)Nc@r�)z4TestCopy.test_deepcopy_inst_getnewargs_ex.<locals>.CcSr0r
r�r�rrrr2r6z<TestCopy.test_deepcopy_inst_getnewargs_ex.<locals>.C.__new__cSr�r�rrrrrr�rXzFTestCopy.test_deepcopy_inst_getnewargs_ex.<locals>.C.__getnewargs_ex__cSr�r
rr�rrrr�r<z;TestCopy.test_deepcopy_inst_getnewargs_ex.<locals>.C.__eq__Nr�rrrrr&r�r&rrrr\rrr� test_deepcopy_inst_getnewargs_exs	
z)TestCopy.test_deepcopy_inst_getnewargs_excCr)Nc@r�)z/TestCopy.test_deepcopy_inst_getstate.<locals>.CcSrr
rr!rrrr"r#z8TestCopy.test_deepcopy_inst_getstate.<locals>.C.__init__cSr�r�rrrrrr�r#z<TestCopy.test_deepcopy_inst_getstate.<locals>.C.__getstate__cSr�r
rr�rrrr�r<z6TestCopy.test_deepcopy_inst_getstate.<locals>.C.__eq__Nr�rrrrr&r�r&rrr\rrr�test_deepcopy_inst_getstaterz$TestCopy.test_deepcopy_inst_getstatecCr)Nc@r�)z/TestCopy.test_deepcopy_inst_setstate.<locals>.CcSrr
rr!rrrr""r#z8TestCopy.test_deepcopy_inst_setstate.<locals>.C.__init__cSr�r�rr�rrrr�$rXz<TestCopy.test_deepcopy_inst_setstate.<locals>.C.__setstate__cSr�r
rr�rrrr�&r<z6TestCopy.test_deepcopy_inst_setstate.<locals>.C.__eq__Nr�rrrrr&!r�r&rrr\rrr�test_deepcopy_inst_setstate rz$TestCopy.test_deepcopy_inst_setstatecCs�Gdd�d�}|dg�}t�|�}|�||�|�||�|�|j|j�|g�}t�|�}|�||�|�||�|�|j|j�dS)Nc@r�)
z8TestCopy.test_deepcopy_inst_getstate_setstate.<locals>.CcSrr
rr!rrrr"0r#zATestCopy.test_deepcopy_inst_getstate_setstate.<locals>.C.__init__cSr�r
rrrrrr�2r�zETestCopy.test_deepcopy_inst_getstate_setstate.<locals>.C.__getstate__cSrr
rr�rrrr�4r#zETestCopy.test_deepcopy_inst_getstate_setstate.<locals>.C.__setstate__cSr�r
rr�rrrr�6r<z?TestCopy.test_deepcopy_inst_getstate_setstate.<locals>.C.__eq__Nr�rrrrr&/r�r&rrr\rrr�$test_deepcopy_inst_getstate_setstate.s
	

z-TestCopy.test_deepcopy_inst_getstate_setstatecCsBGdd�d�}|�}||_t�|�}|�||�|�|j|�dS)Nc@rq)z0TestCopy.test_deepcopy_reflexive_inst.<locals>.CNrrrrrrr&Ertr&)r rr�rArr\rrr�test_deepcopy_reflexive_instDs
z%TestCopy.test_deepcopy_reflexive_instcCsFGdd�dt�}|�}t�|�}|�||�t�|�}|�||�dS)Nc@r/)z+TestCopy.test_reconstruct_string.<locals>.CcSsdS)NrKrrrrrrWQrxz6TestCopy.test_reconstruct_string.<locals>.C.__reduce__Nr`rrrrr&Pr8r&)r+rrr�r\rrr�test_reconstruct_stringOs

z TestCopy.test_reconstruct_stringcsXG�fdd�dt����}d|_t�|�}|�|j|j�t�|�}|�|j|j�dS)Ncr_)z,TestCopy.test_reconstruct_nostate.<locals>.Ccs�dfSr�rrr%rrrW[r�z7TestCopy.test_reconstruct_nostate.<locals>.C.__reduce__Nr`rr%rrr&Zrar&r)r+r rrr,r�rrr%r�test_reconstruct_nostateYs

z!TestCopy.test_reconstruct_nostatec�bG�fdd�dt����}dg|_t�|�}|�||�t�|�}|�||�|�|j|j�dS)NcrG)z*TestCopy.test_reconstruct_state.<locals>.Cc��d|jfSr���__dict__rr%rrrWfr<z5TestCopy.test_reconstruct_state.<locals>.C.__reduce__cSr�r
rr�rrrr�hr<z1TestCopy.test_reconstruct_state.<locals>.C.__eq__N�r(r)r*rWr�rr%rrr&e�r&r�r+r rrr�rArrr%r�test_reconstruct_stateds

zTestCopy.test_reconstruct_statecr)Ncs(eZdZ�fdd�Zdd�Zdd�ZdS)z3TestCopy.test_reconstruct_state_setstate.<locals>.Ccrr�rrr%rrrWtr<z>TestCopy.test_reconstruct_state_setstate.<locals>.C.__reduce__cSs|j�|�dSr
)r�updater�rrrr�v�z@TestCopy.test_reconstruct_state_setstate.<locals>.C.__setstate__cSr�r
rr�rrrr�xr<z:TestCopy.test_reconstruct_state_setstate.<locals>.C.__eq__N)r(r)r*rWr�r�rr%rrr&ssr&rrrrr%r�test_reconstruct_state_setstaters

z(TestCopy.test_reconstruct_state_setstatecCsDGdd�dt�}|�}||_t�|�}|�||�|�|j|�dS)Nc@rq)z.TestCopy.test_reconstruct_reflexive.<locals>.CNrrrrrrr&�rtr&)r+r rr�rArr\rrr�test_reconstruct_reflexive�s
z#TestCopy.test_reconstruct_reflexivecs�G�fdd�dt���ddgdg�}t�|�}|�||�|�||�|�|d|d�t�|�}|�||�|�||�|�|d|d�dS)NcrG)z&TestCopy.test_reduce_4tuple.<locals>.Ccs�d|jt|�fSr�)r�iterrr%rrrW�rz1TestCopy.test_reduce_4tuple.<locals>.C.__reduce__cS�t|�t|�ko
|j|jkSr
)�listrr�rrrr���
�z-TestCopy.test_reduce_4tuple.<locals>.C.__eq__Nrrr%rrr&�rr&rJr|r�r)rrrrArr�rrr%r�test_reduce_4tuple�s

zTestCopy.test_reduce_4tuplecs�G�fdd�dt���dddgfdg�}t�|�}|�||�|�||�|�|d|d�t�|�}|�||�|�||�|�|d|d�dS)NcrG)z&TestCopy.test_reduce_5tuple.<locals>.Ccs�d|jd|��fSr�)r�itemsrr%rrrW�sz1TestCopy.test_reduce_5tuple.<locals>.C.__reduce__cSrr
)�dictrr�rrrr��r z-TestCopy.test_reduce_5tuple.<locals>.C.__eq__Nrrr%rrr&�rr&r rJr|)r�r�)r#rrrArr�rrr%r�test_reduce_5tuple�s

zTestCopy.test_reduce_5tuplecs��fdd��G��fdd�d����}��t��
t�|�Wd�n1s(wY��t��t�|�Wd�dS1sCwYdS)Ncs��d�dSrUrV)�args�kwargsrrr�state_setter�rXz1TestCopy.test_reduce_6tuple.<locals>.state_settercseZdZ��fdd�ZdS)z&TestCopy.test_reduce_6tuple.<locals>.Ccs�d|jdd�fSr�rr�r&r'rrrW�rz1TestCopy.test_reduce_6tuple.<locals>.C.__reduce__Nr`rr(rrr&�sr&�r=r>rr�r�r)r&rr'r�test_reduce_6tuple�s�"�zTestCopy.test_reduce_6tuplecs�G�fdd�d����}|�t��
t�|�Wd�n1s!wY|�t��t�|�Wd�dS1s<wYdS)Ncr_)z+TestCopy.test_reduce_6tuple_none.<locals>.Ccs�d|jdddfSr�rrr%rrrW�rz6TestCopy.test_reduce_6tuple_none.<locals>.C.__reduce__Nr`rr%rrr&�rar&r)r�rr%r�test_reduce_6tuple_none�s�"�z TestCopy.test_reduce_6tuple_nonecCs<Gdd�dt�}|�}dg|_t�|�}|�|j|j�dS)Nc@�eZdZdgZdS)z#TestCopy.test_copy_slots.<locals>.Cr N�r(r)r*�	__slots__rrrrr&��
r&r)r+r rrr\rrr�test_copy_slots�s

zTestCopy.test_copy_slotscCsLGdd�dt�}|�}dg|_t�|�}|�|j|j�|�|j|j�dS)Nc@r,)z'TestCopy.test_deepcopy_slots.<locals>.Cr Nr-rrrrr&�r/r&r)r+r rr�rrAr\rrr�test_deepcopy_slots�s
zTestCopy.test_deepcopy_slotscCsxGdd�dt�}|ddid�}t�|�}|�||�|�|j|j�|�||�d|d<|�||�|�|j|j�dS)Ncs*eZdZd�fdd�	Z�fdd�Z�ZS)z/TestCopy.test_deepcopy_dict_subclass.<locals>.CNcs&|si}t|���|_t��|�dSr
)r�keys�_keys�superr")r�d�r,rrr"�sz8TestCopy.test_deepcopy_dict_subclass.<locals>.C.__init__cs,t��||�||jvr|j�|�dSdSr
)r4�__setitem__r3rM)r�key�itemr6rrr7�s
�z;TestCopy.test_deepcopy_dict_subclass.<locals>.C.__setitem__r
)r(r)r*r"r7�
__classcell__rrr6rr&�sr&r r)r5rJr�)r#rr�rr3rA�assertNotEqualr\rrr�test_deepcopy_dict_subclass�s

z$TestCopy.test_deepcopy_dict_subclasscCs�Gdd�dt�}|ddgdg�}ddg|_t�|�}|�t|�t|��|�|j|j�|�|d|d�|�|j|j�dS)	Nc@rq)z+TestCopy.test_copy_list_subclass.<locals>.CNrrrrrrr&�rtr&rJr|r�r��r)rr rrrr\rrr�test_copy_list_subclass��

z TestCopy.test_copy_list_subclasscCs�Gdd�dt�}|ddgdg�}ddg|_t�|�}|�t|�t|��|�|j|j�|�|d|d�|�|j|j�dS)	Nc@rq)z/TestCopy.test_deepcopy_list_subclass.<locals>.CNrrrrrrr&�rtr&rJr|r�r�r=r)rr rr�rrAr\rrr�test_deepcopy_list_subclass�r?z$TestCopy.test_deepcopy_list_subclasscCsJGdd�dt�}|gd��}|�t|�d�t�|�}|�t|�d�dS)Nc@rq)z,TestCopy.test_copy_tuple_subclass.<locals>.CNrrrrrrr&rtr&r�)�tuplerrr\rrr�test_copy_tuple_subclasss

z!TestCopy.test_copy_tuple_subclasscCs~Gdd�dt�}|ddgdg�}|�t|�ddgdf�t�|�}|�t|�ddgdf�|�||�|�|d|d�dS)Nc@rq)z0TestCopy.test_deepcopy_tuple_subclass.<locals>.CNrrrrrrr&	rtr&rJr|r�r)rArrr�rAr\rrr�test_deepcopy_tuple_subclasss
z%TestCopy.test_deepcopy_tuple_subclasscCs&Gdd�dt�}|�ttj|��dS)Nc@r/)z-TestCopy.test_getstate_exc.<locals>.EvilStatecSstd��)Nzain't got no stickin' state)�
ValueErrorrrrrr�r�z:TestCopy.test_getstate_exc.<locals>.EvilState.__getstate__N)r(r)r*r�rrrr�	EvilStater8rE)r+r=rDr)rrErrr�test_getstate_excszTestCopy.test_getstate_exccCsJ|�t�t�t�dd�}|�t�|�|�dd�}|�t�|�|�dS)NcS�||Sr
r�rrrrrr �z(TestCopy.test_copy_function.<locals>.foocSrvr
rrrrr�<lambda>�z-TestCopy.test_copy_function.<locals>.<lambda>)rr�
global_foo�rr r�rrr�test_copy_function�
zTestCopy.test_copy_functioncCsJ|�t�t�t�dd�}|�t�|�|�dd�}|�t�|�|�dS)NcSrGr
rrHrrrr !rIz,TestCopy.test_deepcopy_function.<locals>.foocSrvr
rrrrrrJ#rKz1TestCopy.test_deepcopy_function.<locals>.<lambda>)rrr�rLrMrrr�test_deepcopy_functionrOzTestCopy.test_deepcopy_functioncCsNGdd�dt�}|�}t�|�}||�}|�||�~||�}|�||�dS)Nc@rq)z"TestCopy._check_weakref.<locals>.CNrrrrrrr&'rtr&)r+�weakref�refr)rZ_copyr&r5rrrrr�_check_weakref&s
zTestCopy._check_weakrefcCs|�tj�dSr
)rSrrrrr�test_copy_weakref1rzTestCopy.test_copy_weakrefcC�|�tj�dSr
)rSrr�rrrr�test_deepcopy_weakref4rzTestCopy.test_deepcopy_weakrefc
s�Gdd�dt���fdd�td�D�\}}}}|�}|||<|||<t�|�}|�||�|�||�|�|||�|�|||�|�t|�d�~~t��|�t|�d�����}}	|	||<|�||�dS)Nc@rq)z(TestCopy._check_copy_weakdict.<locals>.CNrrrrrrr&8rtr&csg|]}���qSrr��.0�ir%rr�
<listcomp>:sz1TestCopy._check_copy_weakdict.<locals>.<listcomp>r�r|rJ)	r+r�rrArr�r�
gc_collectZassertNotIn)
rZ	_dicttype�a�brQr5�u�vrrrr%r�_check_copy_weakdict7s"
zTestCopy._check_copy_weakdictcCrUr
)r`rQ�WeakKeyDictionaryrrrr�test_copy_weakkeydictLrzTestCopy.test_copy_weakkeydictcCrUr
)r`rQ�WeakValueDictionaryrrrr�test_copy_weakvaluedictOrz TestCopy.test_copy_weakvaluedictcs�Gdd�dt���fdd�td�D�\}}}}t��}|||<|||<t�|�}|�||�|�t|�d�|�	|||�|�	|||�|�||j
|j
�|�||j
|j
�~t��|�t|�d�dS)Nc@r/)z-TestCopy.test_deepcopy_weakkeydict.<locals>.CcSrr
�rY�rrYrrrr"Tr#z6TestCopy.test_deepcopy_weakkeydict.<locals>.C.__init__N�r(r)r*r"rrrrr&Sr8r&c�g|]}�|��qSrrrWr%rrrZV�z6TestCopy.test_deepcopy_weakkeydict.<locals>.<listcomp>r�r|rJ)
r+r�rQrarr�r;rr�rArYrr[)rr\r]rQr5r^r_rr%r�test_deepcopy_weakkeydictRs
z"TestCopy.test_deepcopy_weakkeydictcsGdd�dt���fdd�td�D�\}}}}t��}|||<|||<t�|�}|�||�|�t|�d�t	|�
�dd�d	�\\}}\}	}
|�||�|�|j|j�|�
||�|�|	|�|�|	j|j�|�
|
|�~~~	~
~t��|�t|�d
�dS)Nc@r/)z/TestCopy.test_deepcopy_weakvaluedict.<locals>.CcSrr
rerfrrrr"hr#z8TestCopy.test_deepcopy_weakvaluedict.<locals>.C.__init__Nrgrrrrr&gr8r&crhrrrWr%rrrZjriz8TestCopy.test_deepcopy_weakvaluedict.<locals>.<listcomp>r�r|cSs
|djSr�re)ZpairrrrrJrs
z6TestCopy.test_deepcopy_weakvaluedict.<locals>.<lambda>)r8rJ)r+r�rQrcrr�r;rr��sortedr"rArYrrr[)rr\r]rQr5r^r_rr�z�trr%r�test_deepcopy_weakvaluedictfs&
 z$TestCopy.test_deepcopy_weakvaluedictcCsTGdd�dt�}|�}|j|_t�|�}|�|j|j�|�|jj|�|��dS)Nc@r/)z0TestCopy.test_deepcopy_bound_method.<locals>.FoocSrvr
rrrrr�m�rxz2TestCopy.test_deepcopy_bound_method.<locals>.Foo.mN)r(r)r*rorrrr�Foor8rp)r+ror]rr�rr�__self__)rrprw�grrr�test_deepcopy_bound_method~s
z#TestCopy.test_deepcopy_bound_methodN)Qr(r)r*rrr-rDr]rbror�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�r�r�r�r�r�r�rrrrr	r
rrr
rrrrrrr!r$r*r+r0r1r<r>r@rBrCrFrNrPrSrTrVr`rbrdrjrnrsrrrrr	s�




	





	
r	cCrGr
rrHrrrrL�rIrL�__main__)rr?rQr��operatorrrrrrrZunittest�testrr�r�r�ZTestCaser	rLr(�mainrrrr�<module>s. �