Uname:Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64

403WebShell
403Webshell
Server IP : 3.111.61.48  /  Your IP : 216.73.216.67
Web Server : Apache
System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.2.31
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.10/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.10/test/__pycache__/test_copy.cpython-310.pyc
o

�9j�j�@s�dZddlZddlZddlZddlZddlmZmZmZm	Z	m
Z
mZddlZddl
mZeeee	fZe
efZeeZGdd�dej�Zdd�Zed	krQe��dSdS)
zUnit tests for the copy module.�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�error�
assertTrue�
issubclass�	Exception��self�r�%/usr/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
r r��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!�objrrrr3,�
z.TestCopy.test_copy_registry.<locals>.C.__new__N�r)r*r+r3rrrrr'+�r'c��|jffSr
r �r6r&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��failrrrr�
__reduce__?�z2TestCopy.test_copy_reduce_ex.<locals>.C.__reduce__N�r)r*r+rSrYrrQrrr';�r'rK�r,rrr�rr'rrrrQr�test_copy_reduce_ex:�
zTestCopy.test_copy_reduce_excrG)Nc�eZdZ�fdd�ZdS)z$TestCopy.test_copy_reduce.<locals>.CcrIrJrMrrQrrrYIrTz/TestCopy.test_copy_reduce.<locals>.C.__reduce__N�r)r*r+rYrrQrrr'H�r'rKr]r^rrQr�test_copy_reduceG�
zTestCopy.test_copy_reducecCs,Gdd�dt�}|�}|�tjtj|�dS)Nc@r0)z"TestCopy.test_copy_cant.<locals>.CcS�|�d�r	t|��t�||�S�N�__reduce��
startswith�AttributeErrorr,�__getattribute__�r�namerrrrlT�
z3TestCopy.test_copy_cant.<locals>.C.__getattribute__N�r)r*r+rlrrrrr'Sr9r')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^�rvc@rt)z+TestCopy.test_copy_atomic.<locals>.NewStyleNrurrrr�NewStyle`rwrxcS�dSr
rrrrr�fb�z$TestCopy.test_copy_atomic.<locals>.fc@rt)z0TestCopy.test_copy_atomic.<locals>.WithMetaclassNrurrrr�
WithMetaclassdrwr|��	metaclass.r��d���Q�	@TF��?�hello�helloሴsworld��
rK)r,�abc�ABCMeta�NotImplemented�__code__�bytes�range�slice�max�propertyrr)rrvrxrzr|�testsrrrr�test_copy_atomic]s��zTestCopy.test_copy_atomiccCsTgd�}t�|�}|�||�|�||�g}t�|�}|�||�|�||�dS)N�rKr��rrrBrrrr�test_copy_listns

zTestCopy.test_copy_listcCsNd}|�t�|�|�d}|�t�|�|�dddgf}|�t�|�|�dS)Nr�rrKrr�)rr�rrrrr�test_copy_tuplexszTestCopy.test_copy_tuplecCsVddd�}t�|�}|�||�|�||�i}t�|�}|�||�|�||�dS)NrKr�r!�barr�rrrr�test_copy_dict�s


zTestCopy.test_copy_dictcCsVhd�}t�|�}|�||�|�||�t�}t�|�}|�||�|�||�dS�N>rKrr�)rrrB�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rrBrrrr�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
r r"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rqrrr�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
r r"rrrr#�r$z0TestCopy.test_copy_inst_copy.<locals>.C.__init__cr%r
r rr&rrr(�r$z0TestCopy.test_copy_inst_copy.<locals>.C.__copy__cSr�r
r r�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
r r"rrrr#�r$z7TestCopy.test_copy_inst_getinitargs.<locals>.C.__init__cS�|jfSr
r rrrr�__getinitargs__��z>TestCopy.test_copy_inst_getinitargs.<locals>.C.__getinitargs__cSr�r
r r�rrrr��r=z5TestCopy.test_copy_inst_getinitargs.<locals>.C.__eq__N�r)r*r+r#r�r�rrrrr'��r'rr�rqrrr�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>.CcSr1r
��intr3r!�r5r!rrrrr3�r7z5TestCopy.test_copy_inst_getnewargs.<locals>.C.__new__cSr�r
r rrrr�__getnewargs__�r�z<TestCopy.test_copy_inst_getnewargs.<locals>.C.__getnewargs__cSr�r
r r�rrrr��r=z4TestCopy.test_copy_inst_getnewargs.<locals>.C.__eq__N�r)r*r+r3r�r�rrrrr'��r'r�r�r�assertIsInstancerrBr!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>.CcSr1r
r�r�rrrr3�r7z8TestCopy.test_copy_inst_getnewargs_ex.<locals>.C.__new__cS�dd|jifS�Nrr!r rrrr�__getnewargs_ex__�rZzBTestCopy.test_copy_inst_getnewargs_ex.<locals>.C.__getnewargs_ex__cSr�r
r r�rrrr��r=z7TestCopy.test_copy_inst_getnewargs_ex.<locals>.C.__eq__N�r)r*r+r3r�r�rrrrr'�r�r'rr r�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
r r"rrrr#�r$z4TestCopy.test_copy_inst_getstate.<locals>.C.__init__cS�
d|jiS�Nr!r rrrr�__getstate__�r$z8TestCopy.test_copy_inst_getstate.<locals>.C.__getstate__cSr�r
r r�rrrr��r=z2TestCopy.test_copy_inst_getstate.<locals>.C.__eq__N�r)r*r+r#r�r�rrrrr'�r�r'rr�rqrrr�test_copy_inst_getstate�r�z TestCopy.test_copy_inst_getstatecCr�)Nc@r�)z+TestCopy.test_copy_inst_setstate.<locals>.CcSrr
r r"rrrr#�r$z4TestCopy.test_copy_inst_setstate.<locals>.C.__init__cS�|d|_dSr�r �r�staterrr�__setstate__�rZz8TestCopy.test_copy_inst_setstate.<locals>.C.__setstate__cSr�r
r r�rrrr��r=z2TestCopy.test_copy_inst_setstate.<locals>.C.__eq__N�r)r*r+r#r�r�rrrrr'�r�r'rr�rqrrr�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
r r"rrrr#�r$z=TestCopy.test_copy_inst_getstate_setstate.<locals>.C.__init__cS�|jSr
r rrrrr���zATestCopy.test_copy_inst_getstate_setstate.<locals>.C.__getstate__cSrr
r r�rrrr�r$zATestCopy.test_copy_inst_getstate_setstate.<locals>.C.__setstate__cSr�r
r r�rrrr�r=z;TestCopy.test_copy_inst_getstate_setstate.<locals>.C.__eq__N�r)r*r+r#r�r�r�rrrrr'��
r'rgr�rqrrr� 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�NrrK)rr�rrBrrrrr�test_deepcopy_memos
zTestCopy.test_deepcopy_memocCs8Gdd�dt�}Gdd�d|d�}|�t�|�|�dS)Nc@rt)z/TestCopy.test_deepcopy_issubclass.<locals>.MetaNrurrrr�Meta"rwr�c@rt)z,TestCopy.test_deepcopy_issubclass.<locals>.CNrurrrrr'$rwr'r})rCrr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
r r"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@r0)z*TestCopy.test_deepcopy_registry.<locals>.CcSr1r
r2r4rrrr35r7z2TestCopy.test_deepcopy_registry.<locals>.C.__new__Nr8rrrrr'4r9r'cr:r
r r;r&rrr<9r=z1TestCopy.test_deepcopy_registry.<locals>.pickle_Cr)r,r>r?rr�r@rArBrrCr!rDrr&r�test_deepcopy_registry3rFzTestCopy.test_deepcopy_registryc�FG�fdd�dt�}g�|�}t�|�}|�||�|��dg�dS)NcrH)z+TestCopy.test_deepcopy_reduce_ex.<locals>.CcrIrJrMrOrQrrrSErTz9TestCopy.test_deepcopy_reduce_ex.<locals>.C.__reduce_ex__cSrUrVrWrrrrrYHrZz6TestCopy.test_deepcopy_reduce_ex.<locals>.C.__reduce__Nr[rrQrrr'Dr\r'rK�r,rr�rrr^rrQr�test_deepcopy_reduce_exCr`z TestCopy.test_deepcopy_reduce_excr�)Ncra)z(TestCopy.test_deepcopy_reduce.<locals>.CcrIrJrMrrQrrrYRrTz3TestCopy.test_deepcopy_reduce.<locals>.C.__reduce__NrbrrQrrr'Qrcr'rKr�r^rrQr�test_deepcopy_reducePrezTestCopy.test_deepcopy_reducecCs,Gdd�dt�}|�}|�tjtj|�dS)Nc@r0)z&TestCopy.test_deepcopy_cant.<locals>.CcSrfrgrirmrrrrl]roz7TestCopy.test_deepcopy_cant.<locals>.C.__getattribute__Nrprrrrr'\r9r')r,r>rr
r�rqrrr�test_deepcopy_cant[rszTestCopy.test_deepcopy_cantcCszGdd�d�}Gdd�dt�}dd�}ddtdd	d
ddd
dddd|j|td�|tt�g}|D]}|�t�|�|�q/dS)Nc@rt)z.TestCopy.test_deepcopy_atomic.<locals>.ClassicNrurrrrrvgrwrvc@rt)z/TestCopy.test_deepcopy_atomic.<locals>.NewStyleNrurrrrrxirwrxcSryr
rrrrrrzkr{z(TestCopy.test_deepcopy_atomic.<locals>.f.rrr�r�TFr�sbytesr�r�r�)	r,r�r�r�r�r�rrr�)rrvrxrzr�rrrr�test_deepcopy_atomicfs
��zTestCopy.test_deepcopy_atomiccCsFddgdg}t�|�}|�||�|�||�|�|d|d�dS�NrKrr�r�rr�rrBrrrr�test_deepcopy_lists�

zTestCopy.test_deepcopy_listcCsbg}|�|�t�|�}tD]
}|�t|||�q|�||�|�|d|�|�t	|�d�dSr�)
rNrr��comparisonsr>�RecursionErrorrBrr�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)�rKrr�r�rrrr�!test_deepcopy_tuple_of_immutables�rz*TestCopy.test_deepcopy_tuple_of_immutablescCspgf}|d�|�t�|�}tD]
}|�t|||�q|�||�|�|d|d�|�|dd|�dS�Nr)rNrr�r�r>r�rBrr�rrr�test_deepcopy_reflexive_tuple�s
z&TestCopy.test_deepcopy_reflexive_tuplecCsHddgdd�}t�|�}|�||�|�||�|�|d|d�dS)NrKrr�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!rK)rr��order_comparisonsr>r?�equality_comparisonsr�rBrrr�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)rKrr��rr�)rr�rr�rrrr�!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
r r"rrrr#�r$z7TestCopy.test_deepcopy_inst_vanilla.<locals>.C.__init__cSr�r
r r�rrrr��r=z5TestCopy.test_deepcopy_inst_vanilla.<locals>.C.__eq__Nr�rrrrr'�r�r'r�rr�rrBr!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
r r"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
r r�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
r r"rrrr#�r$z;TestCopy.test_deepcopy_inst_getinitargs.<locals>.C.__init__cSr�r
r rrrrr��r�zBTestCopy.test_deepcopy_inst_getinitargs.<locals>.C.__getinitargs__cSr�r
r r�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>.CcSr1r
r�r�rrrr3�r7z9TestCopy.test_deepcopy_inst_getnewargs.<locals>.C.__new__cSr�r
r rrrrr��r�z@TestCopy.test_deepcopy_inst_getnewargs.<locals>.C.__getnewargs__cSr�r
r r�rrrr��r=z8TestCopy.test_deepcopy_inst_getnewargs.<locals>.C.__eq__Nr�rrrrr'�r�r'r�r�rr�r�rrBr!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>.CcSr1r
r�r�rrrr3r7z<TestCopy.test_deepcopy_inst_getnewargs_ex.<locals>.C.__new__cSr�r�r rrrrr�rZzFTestCopy.test_deepcopy_inst_getnewargs_ex.<locals>.C.__getnewargs_ex__cSr�r
r r�rrrr�r=z;TestCopy.test_deepcopy_inst_getnewargs_ex.<locals>.C.__eq__Nr�rrrrr'r�r'rr rr^rrr� test_deepcopy_inst_getnewargs_exs	
z)TestCopy.test_deepcopy_inst_getnewargs_excCr)Nc@r�)z/TestCopy.test_deepcopy_inst_getstate.<locals>.CcSrr
r r"rrrr#r$z8TestCopy.test_deepcopy_inst_getstate.<locals>.C.__init__cSr�r�r rrrrr�r$z<TestCopy.test_deepcopy_inst_getstate.<locals>.C.__getstate__cSr�r
r r�rrrr�r=z6TestCopy.test_deepcopy_inst_getstate.<locals>.C.__eq__Nr�rrrrr'r�r'rrr^rrr�test_deepcopy_inst_getstater
z$TestCopy.test_deepcopy_inst_getstatecCr)Nc@r�)z/TestCopy.test_deepcopy_inst_setstate.<locals>.CcSrr
r r"rrrr#"r$z8TestCopy.test_deepcopy_inst_setstate.<locals>.C.__init__cSr�r�r r�rrrr�$rZz<TestCopy.test_deepcopy_inst_setstate.<locals>.C.__setstate__cSr�r
r r�rrrr�&r=z6TestCopy.test_deepcopy_inst_setstate.<locals>.C.__eq__Nr�rrrrr'!r�r'rrr^rrr�test_deepcopy_inst_setstate r
z$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
r r"rrrr#0r$zATestCopy.test_deepcopy_inst_getstate_setstate.<locals>.C.__init__cSr�r
r rrrrr�2r�zETestCopy.test_deepcopy_inst_getstate_setstate.<locals>.C.__getstate__cSrr
r r�rrrr�4r$zETestCopy.test_deepcopy_inst_getstate_setstate.<locals>.C.__setstate__cSr�r
r r�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@rt)z0TestCopy.test_deepcopy_reflexive_inst.<locals>.CNrurrrrr'Erwr')r!rr�rBrr^rrr�test_deepcopy_reflexive_instDs
z%TestCopy.test_deepcopy_reflexive_instcCsFGdd�dt�}|�}t�|�}|�||�t�|�}|�||�dS)Nc@r0)z+TestCopy.test_reconstruct_string.<locals>.CcSsdS)NrLrrrrrrYQr{z6TestCopy.test_reconstruct_string.<locals>.C.__reduce__Nrbrrrrr'Pr9r')r,rrr�r^rrr�test_reconstruct_stringOs

z TestCopy.test_reconstruct_stringcsXG�fdd�dt����}d|_t�|�}|�|j|j�t�|�}|�|j|j�dS)Ncra)z,TestCopy.test_reconstruct_nostate.<locals>.Ccs�dfSr�rrr&rrrY[r�z7TestCopy.test_reconstruct_nostate.<locals>.C.__reduce__Nrbrr&rrr'Zrcr'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)NcrH)z*TestCopy.test_reconstruct_state.<locals>.Cc��d|jfSr���__dict__rr&rrrYfr=z5TestCopy.test_reconstruct_state.<locals>.C.__reduce__cSr�r
rr�rrrr�hr=z1TestCopy.test_reconstruct_state.<locals>.C.__eq__N�r)r*r+rYr�rr&rrr'e�r'r�r,r!rrr�rBrrr&r�test_reconstruct_stateds

zTestCopy.test_reconstruct_statecr)Ncs(eZdZ�fdd�Zdd�Zdd�ZdS)z3TestCopy.test_reconstruct_state_setstate.<locals>.Ccrr�rrr&rrrYtr=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+rYr�r�rr&rrr'ssr'rrrrr&r�test_reconstruct_state_setstaters

z(TestCopy.test_reconstruct_state_setstatecCsDGdd�dt�}|�}||_t�|�}|�||�|�|j|�dS)Nc@rt)z.TestCopy.test_reconstruct_reflexive.<locals>.CNrurrrrr'�rwr')r,r!rr�rBrr^rrr�test_reconstruct_reflexive�s
z#TestCopy.test_reconstruct_reflexivecs�G�fdd�dt���ddgdg�}t�|�}|�||�|�||�|�|d|d�t�|�}|�||�|�||�|�|d|d�dS)NcrH)z&TestCopy.test_reduce_4tuple.<locals>.Ccs�d|jt|�fSr�)r�iterrr&rrrY�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'rKrr�r)r"rrrBrr�rrr&r�test_reduce_4tuple�s

zTestCopy.test_reduce_4tuplecs�G�fdd�dt���dddgfdg�}t�|�}|�||�|�||�|�|d|d�t�|�}|�||�|�||�|�|d|d�dS)NcrH)z&TestCopy.test_reduce_5tuple.<locals>.Ccs�d|jd|��fSr�)r�itemsrr&rrrY�sz1TestCopy.test_reduce_5tuple.<locals>.C.__reduce__cSr!r
)�dictrr�rrrr��r#z-TestCopy.test_reduce_5tuple.<locals>.C.__eq__Nrrr&rrr'�rr'r!rKr)r�r�)r&rrrBrr�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�dSrVrW)�args�kwargsrrr�state_setter�rZz1TestCopy.test_reduce_6tuple.<locals>.state_settercseZdZ��fdd�ZdS)z&TestCopy.test_reduce_6tuple.<locals>.Ccs�d|jdd�fSr�rr�r'r*rrrY�rz1TestCopy.test_reduce_6tuple.<locals>.C.__reduce__Nrbrr+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)Ncra)z+TestCopy.test_reduce_6tuple_none.<locals>.Ccs�d|jdddfSr�rrr&rrrY�rz6TestCopy.test_reduce_6tuple_none.<locals>.C.__reduce__Nrbrr&rrr'�rcr'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!Nr0rrrrr'�r2r'r)r,r!rr�rrBr^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
)r7�__setitem__r6rN)r�key�itemr9rrr:�s
�z;TestCopy.test_deepcopy_dict_subclass.<locals>.C.__setitem__r
)r)r*r+r#r:�
__classcell__rrr9rr'�sr'r!r)r8rKr�)r&rr�rr6rB�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@rt)z+TestCopy.test_copy_list_subclass.<locals>.CNrurrrrr'�rwr'rKrr�r�r)r"r!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@rt)z/TestCopy.test_deepcopy_list_subclass.<locals>.CNrurrrrr'�rwr'rKrr�rr@r)r"r!rr�rrBr^rrr�test_deepcopy_list_subclass�rBz$TestCopy.test_deepcopy_list_subclasscCsJGdd�dt�}|gd��}|�t|�d�t�|�}|�t|�d�dS)Nc@rt)z,TestCopy.test_copy_tuple_subclass.<locals>.CNrurrrrr'rwr'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@rt)z0TestCopy.test_deepcopy_tuple_subclass.<locals>.CNrurrrrr'	rwr'rKrr�r)rDrrr�rBr^rrr�test_deepcopy_tuple_subclasss
z%TestCopy.test_deepcopy_tuple_subclasscCs&Gdd�dt�}|�ttj|��dS)Nc@r0)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�	EvilStater9rH)r,r>rGr)rrHrrr�test_getstate_excszTestCopy.test_getstate_exccCsJ|�t�t�t�dd�}|�t�|�|�dd�}|�t�|�|�dS)NcS�||Sr
r�rrrrrr!�z(TestCopy.test_copy_function.<locals>.foocSryr
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)NcSrJr
rrKrrrr!!rLz,TestCopy.test_deepcopy_function.<locals>.foocSryr
rrrrrrM#rNz1TestCopy.test_deepcopy_function.<locals>.<lambda>)rrr�rOrPrrr�test_deepcopy_functionrRzTestCopy.test_deepcopy_functioncCsNGdd�dt�}|�}t�|�}||�}|�||�~||�}|�||�dS)Nc@rt)z"TestCopy._check_weakref.<locals>.CNrurrrrr''rwr')r,�weakref�refr)r�_copyr'r6rrrrr�_check_weakref&s
zTestCopy._check_weakrefcCs|�tj�dSr
)rWrrrrr�test_copy_weakref1rzTestCopy.test_copy_weakrefcC�|�tj�dSr
)rWrr�rrrr�test_deepcopy_weakref4rzTestCopy.test_deepcopy_weakrefc
s�Gdd�dt���fdd�td�D�\}}}}|�}|||<|||<t�|�}|�||�|�||�|�|||�|�|||�|�t|�d�~~t��|�t|�d�����}}	|	||<|�||�dS)Nc@rt)z(TestCopy._check_copy_weakdict.<locals>.CNrurrrrr'8rwr'csg|]}���qSrr��.0�ir&rr�
<listcomp>:sz1TestCopy._check_copy_weakdict.<locals>.<listcomp>rrrK)	r,r�rrBrr�r�
gc_collect�assertNotIn)
r�	_dicttype�a�brRr8�u�vrrrr&r�_check_copy_weakdict7s"
zTestCopy._check_copy_weakdictcCrYr
)rfrT�WeakKeyDictionaryrrrr�test_copy_weakkeydictLrzTestCopy.test_copy_weakkeydictcCrYr
)rfrT�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@r0)z-TestCopy.test_deepcopy_weakkeydict.<locals>.CcSrr
�r]�rr]rrrr#Tr$z6TestCopy.test_deepcopy_weakkeydict.<locals>.C.__init__N�r)r*r+r#rrrrr'Sr9r'c�g|]}�|��qSrrr[r&rrr^V�z6TestCopy.test_deepcopy_weakkeydict.<locals>.<listcomp>rrrK)
r,r�rTrgrr�r>rr�rBr]rr_)rrbrcrRr8rdrerr&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@r0)z/TestCopy.test_deepcopy_weakvaluedict.<locals>.CcSrr
rkrlrrrr#hr$z8TestCopy.test_deepcopy_weakvaluedict.<locals>.C.__init__Nrmrrrrr'gr9r'crnrrr[r&rrr^jroz8TestCopy.test_deepcopy_weakvaluedict.<locals>.<listcomp>rrcSs
|djSr�rk)�pairrrrrMrs
z6TestCopy.test_deepcopy_weakvaluedict.<locals>.<lambda>)r;rK)r,r�rTrirr�r>rr��sortedr%rBr]rrr_)rrbrcrRr8rdrerr�z�trr&r�test_deepcopy_weakvaluedictfs&
 z$TestCopy.test_deepcopy_weakvaluedictcCsTGdd�dt�}|�}|j|_t�|�}|�|j|j�|�|jj|�|��dS)Nc@r0)z0TestCopy.test_deepcopy_bound_method.<locals>.FoocSryr
rrrrr�m�r{z2TestCopy.test_deepcopy_bound_method.<locals>.Foo.mN)r)r*r+rvrrrr�Foor9rw)r,rvrcrr�rr�__self__)rrwrz�grrr�test_deepcopy_bound_method~s
z#TestCopy.test_deepcopy_bound_methodN)Qr)r*r+rrr.rEr_rdrrr�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r
rrrrrrrrrr$r'r-r.r3r4r?rArCrErFrIrQrSrWrXrZrfrhrjrprurzrrrrr	s�




	





	
r	cCrJr
rrKrrrrO�rLrO�__main__)�__doc__rr@rTr��operatorrrrrrr�unittest�testrr�r�r��TestCaser	rOr)�mainrrrr�<module>s. �

Youez - 2016 - github.com/yon3zu
LinuXploit