HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/Python311/Lib/test/__pycache__/test_copy.cpython-311.opt-2.pyc
�

��Vcm����	ddlZddlZddlZddlZddlmZmZmZmZm	Z	m
Z
ddlZddlm
Z
eeeefZe	e
fZeezZGd�dej��Zd�Zedkrej��dSdS)�N)�le�lt�ge�gt�eq�ne)�supportc���eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�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�ZPdOS)P�TestCopyc��|�tjtj��|�ttjt����dS�N)�assertIs�copy�Error�error�
assertTrue�
issubclass�	Exception��selfs �"D:\Python311\Lib\test\test_copy.py�test_exceptionszTestCopy.test_exceptionss>���
�
�d�j�$�*�-�-�-����
�4�:�y�9�9�:�:�:�:�:�c�^�d}tj|��}|�||��dS�N�*)r�assertEqual�r�x�ys   r�test_copy_basiczTestCopy.test_copy_basics0�����I�a�L�L������A�����rc����G�fd�dt����d��}tj|��}|�|j|j��|�|j|j��dS)Nc� ��eZdZd�Z�fd�ZdS)�"TestCopy.test_copy_copy.<locals>.Cc��||_dSr
��foo�rr's  r�__init__z+TestCopy.test_copy_copy.<locals>.C.__init__!�
������rc�$���|j��Sr
r&�r�Cs �r�__copy__z+TestCopy.test_copy_copy.<locals>.C.__copy__#�����q���{�{�"rN)�__name__�
__module__�__qualname__r)r.�r-s�rr-r$ s=�������
�
�
�
#�
#�
#�
#�
#�
#�
#rr-r)�objectrr�	__class__r'�rrr r-s   @r�test_copy_copyzTestCopy.test_copy_copys����	#�	#�	#�	#�	#�	#�	#��	#�	#�	#�

�A�b�E�E���I�a�L�L�������a�k�2�2�2��������&�&�&�&�&rc����Gd�dt����fd�}�d��}|�ttj|��t	j�|���tj|��}dS)Nc��eZdZd�ZdS)�&TestCopy.test_copy_registry.<locals>.Cc�H�t�|��}||_|Sr
�r4�__new__r'��clsr'�objs   rr=z.TestCopy.test_copy_registry.<locals>.C.__new__,����n�n�S�)�)������
rN�r0r1r2r=�rrr-r:+�#������
�
�
�
�
rr-c����|jffSr
r&�r@r-s �r�pickle_Cz-TestCopy.test_copy_registry.<locals>.pickle_C0�������z�?�"rr)r4�assertRaises�	TypeErrorr�copyreg�pickle�rrGrr r-s    @r�test_copy_registryzTestCopy.test_copy_registry*s����	�	�	�	�	��	�	�	�
	#�	#�	#�	#�	#�
�A�b�E�E�����)�T�Y��2�2�2���q�(�A�&�&�&��I�a�L�L���rc����G�fd�dt��}g�|��}tj|��}|�||��|��dg��dS)Nc� ��eZdZ�fd�Zd�ZdS)�'TestCopy.test_copy_reduce_ex.<locals>.Cc�2����d��dS�N����append�r�proto�cs  �r�
__reduce_ex__z5TestCopy.test_copy_reduce_ex.<locals>.C.__reduce_ex__9������������rrc�0�|�d��dS�Nzshouldn't call this��failrs r�
__reduce__z2TestCopy.test_copy_reduce_ex.<locals>.C.__reduce__<����	�	�/�0�0�0�0�0rN�r0r1r2r[ra�rZs�rr-rQ8�=�������
�
�
�
�
�
1�
1�
1�
1�
1rr-rT�r4rrr�rr-rr rZs    @r�test_copy_reduce_exzTestCopy.test_copy_reduce_ex7s����	1�	1�	1�	1�	1�	1�	1��	1�	1�	1�
��
�A�C�C���I�a�L�L���
�
�a���������Q�C� � � � � rc����G�fd�dt��}g�|��}tj|��}|�||��|��dg��dS)Nc���eZdZ�fd�ZdS)�$TestCopy.test_copy_reduce.<locals>.Cc�2����d��dSrSrV�rrZs �rraz/TestCopy.test_copy_reduce.<locals>.C.__reduce__Fr\rN�r0r1r2rards�rr-rkE�.�������
�
�
�
�
�
�
rr-rTrfrgs    @r�test_copy_reducezTestCopy.test_copy_reduceDs����	�	�	�	�	�	�	��	�	�	�
��
�A�C�C���I�a�L�L���
�
�a���������Q�C� � � � � rc��Gd�dt��}|��}|�tjtj|��dS)Nc��eZdZd�ZdS)�"TestCopy.test_copy_cant.<locals>.Cc��|�d��rt|���t�||��S�N�__reduce��
startswith�AttributeErrorr4�__getattribute__�r�names  rrzz3TestCopy.test_copy_cant.<locals>.C.__getattribute__Q�:���?�?�:�.�.�/�(��.�.�.��.�.�t�T�:�:�:rN�r0r1r2rzrCrrr-rsP�#������
;�
;�
;�
;�
;rr-)r4rIrr�rr-rs   r�test_copy_cantzTestCopy.test_copy_cantOs[��	;�	;�	;�	;�	;��	;�	;�	;�

�A�C�C�����$�*�d�i��3�3�3�3�3rc��Gd�d��}Gd�dt��}d�}Gd�dtj���}dd	td
ddzd
ddddd|jdtt
d����t
d��tddd��||t|t��g}|D]*}|�
tj|��|���+dS)Nc��eZdZdS)�*TestCopy.test_copy_atomic.<locals>.ClassicN�r0r1r2rCrr�Classicr�[��������Drr�c��eZdZdS)�+TestCopy.test_copy_atomic.<locals>.NewStyleNr�rCrr�NewStyler�]r�rr�c��dSr
rCrCrr�fz$TestCopy.test_copy_atomic.<locals>.f_����Drc��eZdZdS)�0TestCopy.test_copy_atomic.<locals>.WithMetaclassNr�rCrr�
WithMetaclassr�ar�rr���	metaclass.r��d���Q�	@TF��?�hello�helloሴsworld��
rT)r4�abc�ABCMeta�NotImplemented�__code__�bytes�range�slice�max�propertyrr)rr�r�r�r��testsrs       r�test_copy_atomiczTestCopy.test_copy_atomicZs-��	�	�	�	�	�	�	�	�	�	�	�	�	�v�	�	�	�	�	�	�	�	�	�	�	�c�k�	�	�	�	��s�N��Q��V�T�4����-����5��s���,�,�e�B�i�i��q�"�a����7�C���
�
�	D��
�	+�	+�A��M�M�$�)�A�,�,��*�*�*�*�	+�	+rc��gd�}tj|��}|�||��|�||��g}tj|��}|�||��|�||��dS)N�rTr���rr�assertIsNotrs   r�test_copy_listzTestCopy.test_copy_listks����I�I���I�a�L�L������A��������A�������I�a�L�L������A��������A�����rc�
�d}|�tj|��|��d}|�tj|��|��dddgf}|�tj|��|��dS)Nr�rCrTr�r�)rr�rrs  r�test_copy_tuplezTestCopy.test_copy_tupleuss�����
�
�d�i��l�l�A�&�&�&����
�
�d�i��l�l�A�&�&�&�
��1�b�M���
�
�d�i��l�l�A�&�&�&�&�&rc��ddd�}tj|��}|�||��|�||��i}tj|��}|�||��|�||��dS)NrTr��r'�barr�rs   r�test_copy_dictzTestCopy.test_copy_dict}s����a� � ���I�a�L�L������A��������A�������I�a�L�L������A��������A�����rc�*�hd�}tj|��}|�||��|�||��t��}tj|��}|�||��|�||��dS�N>rTr�r�)rrr��setrs   r�
test_copy_setzTestCopy.test_copy_set�s����I�I���I�a�L�L������A��������A�����E�E���I�a�L�L������A��������A�����rc���thd���}|�tj|��|��t��}|�tj|��|��dSr�)�	frozensetrrr�s  r�test_copy_frozensetzTestCopy.test_copy_frozenset�sZ���i�i�i� � ���
�
�d�i��l�l�A�&�&�&��K�K���
�
�d�i��l�l�A�&�&�&�&�&rc�@�td��}tj|��}|�||��|�||��t��}tj|��}|�||��|�||��dS)Nsabc)�	bytearrayrrr�rs   r�test_copy_bytearrayzTestCopy.test_copy_bytearray�s����f�����I�a�L�L������A��������A�����K�K���I�a�L�L������A��������A�����rc��Gd�d��}|d��}|�tj|��|��dS)Nc��eZdZd�Zd�ZdS)�*TestCopy.test_copy_inst_vanilla.<locals>.Cc��||_dSr
r&r(s  rr)z3TestCopy.test_copy_inst_vanilla.<locals>.C.__init__�r*rc�"�|j|jkSr
r&�r�others  r�__eq__z1TestCopy.test_copy_inst_vanilla.<locals>.C.__eq__�����x�5�9�,�,rN�r0r1r2r)r�rCrrr-r���2������
�
�
�
-�
-�
-�
-�
-rr-r�rrr�s   r�test_copy_inst_vanillazTestCopy.test_copy_inst_vanilla�s]��	-�	-�	-�	-�	-�	-�	-�	-�

�A�b�E�E�������1���q�)�)�)�)�)rc���G�fd�d����d��}|�tj|��|��dS)Nc�&��eZdZd�Z�fd�Zd�ZdS)�'TestCopy.test_copy_inst_copy.<locals>.Cc��||_dSr
r&r(s  rr)z0TestCopy.test_copy_inst_copy.<locals>.C.__init__�r*rc�$���|j��Sr
r&r,s �rr.z0TestCopy.test_copy_inst_copy.<locals>.C.__copy__�r/rc�"�|j|jkSr
r&r�s  rr�z.TestCopy.test_copy_inst_copy.<locals>.C.__eq__�r�rN)r0r1r2r)r.r�r3s�rr-r��sL�������
�
�
�
#�
#�
#�
#�
#�
-�
-�
-�
-�
-rr-rr��rrr-s  @r�test_copy_inst_copyzTestCopy.test_copy_inst_copy�sh���	-�	-�	-�	-�	-�	-�	-�	-�	-�	-�
�A�b�E�E�������1���q�)�)�)�)�)rc��Gd�d��}|d��}|�tj|��|��dS)Nc� �eZdZd�Zd�Zd�ZdS)�.TestCopy.test_copy_inst_getinitargs.<locals>.Cc��||_dSr
r&r(s  rr)z7TestCopy.test_copy_inst_getinitargs.<locals>.C.__init__�r*rc��|jfSr
r&rs r�__getinitargs__z>TestCopy.test_copy_inst_getinitargs.<locals>.C.__getinitargs__������{�"rc�"�|j|jkSr
r&r�s  rr�z5TestCopy.test_copy_inst_getinitargs.<locals>.C.__eq__�r�rN�r0r1r2r)r�r�rCrrr-r���A������
�
�
�
#�
#�
#�
-�
-�
-�
-�
-rr-rr�r�s   r�test_copy_inst_getinitargsz#TestCopy.test_copy_inst_getinitargs��]��	-�	-�	-�	-�	-�	-�	-�	-�
�A�b�E�E�������1���q�)�)�)�)�)rc�.�Gd�dt��}|d��}tj|��}|�||��|�||��|�||��|�|j|j��dS)Nc� �eZdZd�Zd�Zd�ZdS)�-TestCopy.test_copy_inst_getnewargs.<locals>.Cc�H�t�|��}||_|Sr
��intr=r'�r?r'rs   rr=z5TestCopy.test_copy_inst_getnewargs.<locals>.C.__new__�����{�{�3�'�'������rc��|jfSr
r&rs r�__getnewargs__z<TestCopy.test_copy_inst_getnewargs.<locals>.C.__getnewargs__�����x�y� rc�"�|j|jkSr
r&r�s  rr�z4TestCopy.test_copy_inst_getnewargs.<locals>.C.__eq__�r�rN�r0r1r2r=r�r�rCrrr-r���A������
�
�
�
!�
!�
!�
-�
-�
-�
-�
-rr-r�r�r�assertIsInstancerr�r'�rr-rr s    r�test_copy_inst_getnewargsz"TestCopy.test_copy_inst_getnewargs�s���	-�	-�	-�	-�	-��	-�	-�	-�
�A�b�E�E���I�a�L�L�����a��#�#�#�����A��������A�����������&�&�&�&�&rc�0�Gd�dt��}|d���}tj|��}|�||��|�||��|�||��|�|j|j��dS)Nc� �eZdZd�Zd�Zd�ZdS)�0TestCopy.test_copy_inst_getnewargs_ex.<locals>.Cc�H�t�|��}||_|Sr
r�r�s   rr=z8TestCopy.test_copy_inst_getnewargs_ex.<locals>.C.__new__�r�rc��dd|jifS�NrCr'r&rs r�__getnewargs_ex__zBTestCopy.test_copy_inst_getnewargs_ex.<locals>.C.__getnewargs_ex__�����E�4�8�,�,�,rc�"�|j|jkSr
r&r�s  rr�z7TestCopy.test_copy_inst_getnewargs_ex.<locals>.C.__eq__�r�rN�r0r1r2r=r�r�rCrrr-r���A������
�
�
�
-�
-�
-�
-�
-�
-�
-�
-rr-rr&r�r�s    r�test_copy_inst_getnewargs_exz%TestCopy.test_copy_inst_getnewargs_ex�s���	-�	-�	-�	-�	-��	-�	-�	-�
�A�"�I�I�I���I�a�L�L�����a��#�#�#�����A��������A�����������&�&�&�&�&rc��Gd�d��}|d��}|�tj|��|��dS)Nc� �eZdZd�Zd�Zd�ZdS)�+TestCopy.test_copy_inst_getstate.<locals>.Cc��||_dSr
r&r(s  rr)z4TestCopy.test_copy_inst_getstate.<locals>.C.__init__�r*rc��d|jiS�Nr'r&rs r�__getstate__z8TestCopy.test_copy_inst_getstate.<locals>.C.__getstate__�����t�x�(�(rc�"�|j|jkSr
r&r�s  rr�z2TestCopy.test_copy_inst_getstate.<locals>.C.__eq__�r�rN�r0r1r2r)rr�rCrrr-r���A������
�
�
�
)�
)�
)�
-�
-�
-�
-�
-rr-rr�r�s   r�test_copy_inst_getstatez TestCopy.test_copy_inst_getstate�r�rc��Gd�d��}|d��}|�tj|��|��dS)Nc� �eZdZd�Zd�Zd�ZdS)�+TestCopy.test_copy_inst_setstate.<locals>.Cc��||_dSr
r&r(s  rr)z4TestCopy.test_copy_inst_setstate.<locals>.C.__init__�r*rc� �|d|_dSrr&�r�states  r�__setstate__z8TestCopy.test_copy_inst_setstate.<locals>.C.__setstate__���� ��<����rc�"�|j|jkSr
r&r�s  rr�z2TestCopy.test_copy_inst_setstate.<locals>.C.__eq__�r�rN�r0r1r2r)rr�rCrrr-r
��A������
�
�
�
(�
(�
(�
-�
-�
-�
-�
-rr-rr�r�s   r�test_copy_inst_setstatez TestCopy.test_copy_inst_setstate�r�rc���Gd�d��}|d��}|�tj|��|��|d��}|�tj|��|��dS)Nc�&�eZdZd�Zd�Zd�Zd�ZdS)�4TestCopy.test_copy_inst_getstate_setstate.<locals>.Cc��||_dSr
r&r(s  rr)z=TestCopy.test_copy_inst_getstate_setstate.<locals>.C.__init__�r*rc��|jSr
r&rs rrzATestCopy.test_copy_inst_getstate_setstate.<locals>.C.__getstate__��	���x�rc��||_dSr
r&r
s  rrzATestCopy.test_copy_inst_getstate_setstate.<locals>.C.__setstate__��
�� ����rc�"�|j|jkSr
r&r�s  rr�z;TestCopy.test_copy_inst_getstate_setstate.<locals>.C.__eq__r�rN�r0r1r2r)rrr�rCrrr-r��P������
�
�
�
 �
 �
 �
!�
!�
!�
-�
-�
-�
-�
-rr-rgr�r�s   r� test_copy_inst_getstate_setstatez)TestCopy.test_copy_inst_getstate_setstate�s���	-�	-�	-�	-�	-�	-�	-�	-�
�A�b�E�E�������1���q�)�)�)�
�A�c�F�F�������1���q�)�)�)�)�)rc�^�d}tj|��}|�||��dSr)r�deepcopyrrs   r�test_deepcopy_basiczTestCopy.test_deepcopy_basic
s2�����M�!��������A�����rc��g}||g}tj|��}|�||��|�||��|�|d|d��|�|d|d��dS�NrrT)rr"rr�rrs   r�test_deepcopy_memozTestCopy.test_deepcopy_memos���
��
��F���M�!��������A��������A��������1��q��t�$�$�$��
�
�a��d�A�a�D�!�!�!�!�!rc��Gd�dt��}Gd�d|���}|�tj|��|��dS)Nc��eZdZdS)�/TestCopy.test_deepcopy_issubclass.<locals>.MetaNr�rCrr�Metar)r�rr*c��eZdZdS)�,TestCopy.test_deepcopy_issubclass.<locals>.CNr�rCrrr-r,!r�rr-r�)�typerrr")rr*r-s   r�test_deepcopy_issubclassz!TestCopy.test_deepcopy_issubclasss���
	�	�	�	�	�4�	�	�	�	�	�	�	�	�$�	�	�	�	������q�)�)�1�-�-�-�-�-rc����G�fd�dt����d��}tj|��}|�|j|j��|�|j|j��dS)Nc�"��eZdZd�Zd�fd�	ZdS)�*TestCopy.test_deepcopy_deepcopy.<locals>.Cc��||_dSr
r&r(s  rr)z3TestCopy.test_deepcopy_deepcopy.<locals>.C.__init__'r*rNc�$���|j��Sr
r&�r�memor-s  �r�__deepcopy__z7TestCopy.test_deepcopy_deepcopy.<locals>.C.__deepcopy__)r/rr
)r0r1r2r)r6r3s�rr-r1&sB�������
�
�
�
#�
#�
#�
#�
#�
#�
#�
#rr-r)r4rr"rr5r'r6s   @r�test_deepcopy_deepcopyzTestCopy.test_deepcopy_deepcopy%s����	#�	#�	#�	#�	#�	#�	#��	#�	#�	#�

�A�b�E�E���M�!���������a�k�2�2�2��������&�&�&�&�&rc����Gd�dt����fd�}�d��}|�ttj|��tj�|���tj|��}dS)Nc��eZdZd�ZdS)�*TestCopy.test_deepcopy_registry.<locals>.Cc�H�t�|��}||_|Sr
r<r>s   rr=z2TestCopy.test_deepcopy_registry.<locals>.C.__new__2rArNrBrCrrr-r:1rDrr-c����|jffSr
r&rFs �rrGz1TestCopy.test_deepcopy_registry.<locals>.pickle_C6rHrr)r4rIrJrr"rKrLrMs    @r�test_deepcopy_registryzTestCopy.test_deepcopy_registry0s����	�	�	�	�	��	�	�	�
	#�	#�	#�	#�	#�
�A�b�E�E�����)�T�]�A�6�6�6���q�(�A�&�&�&��M�!�����rc����G�fd�dt��}g�|��}tj|��}|�||��|��dg��dS)Nc� ��eZdZ�fd�Zd�ZdS)�+TestCopy.test_deepcopy_reduce_ex.<locals>.Cc�2����d��dSrSrVrXs  �rr[z9TestCopy.test_deepcopy_reduce_ex.<locals>.C.__reduce_ex__?r\rc�0�|�d��dSr^r_rs rraz6TestCopy.test_deepcopy_reduce_ex.<locals>.C.__reduce__BrbrNrcrds�rr-r@>rerr-rT�r4rr"rrrgs    @r�test_deepcopy_reduce_exz TestCopy.test_deepcopy_reduce_ex=s����	1�	1�	1�	1�	1�	1�	1��	1�	1�	1�
��
�A�C�C���M�!�����
�
�a���������Q�C� � � � � rc����G�fd�dt��}g�|��}tj|��}|�||��|��dg��dS)Nc���eZdZ�fd�ZdS)�(TestCopy.test_deepcopy_reduce.<locals>.Cc�2����d��dSrSrVrms �rraz3TestCopy.test_deepcopy_reduce.<locals>.C.__reduce__Lr\rNrnrds�rr-rGKrorr-rTrCrgs    @r�test_deepcopy_reducezTestCopy.test_deepcopy_reduceJs����	�	�	�	�	�	�	��	�	�	�
��
�A�C�C���M�!�����
�
�a���������Q�C� � � � � rc��Gd�dt��}|��}|�tjtj|��dS)Nc��eZdZd�ZdS)�&TestCopy.test_deepcopy_cant.<locals>.Cc��|�d��rt|���t�||��Srurwr{s  rrzz7TestCopy.test_deepcopy_cant.<locals>.C.__getattribute__Wr}rNr~rCrrr-rLVrrr-)r4rIrrr"r�s   r�test_deepcopy_cantzTestCopy.test_deepcopy_cantUs[��	;�	;�	;�	;�	;��	;�	;�	;�

�A�C�C�����$�*�d�m�Q�7�7�7�7�7rc��Gd�d��}Gd�dt��}d�}ddddzd	d
ddd
d|j|td��|tt	��g}|D]*}|�t
j|��|���+dS)Nc��eZdZdS)�.TestCopy.test_deepcopy_atomic.<locals>.ClassicNr�rCrrr�rQar�rr�c��eZdZdS)�/TestCopy.test_deepcopy_atomic.<locals>.NewStyleNr�rCrrr�rScr�rr�c��dSr
rCrCrrr�z(TestCopy.test_deepcopy_atomic.<locals>.fer�rrr�r�r�TFr�r�r�r�)r4r�r�r�r�rrr")rr�r�r�r�rs      r�test_deepcopy_atomiczTestCopy.test_deepcopy_atomic`s���	�	�	�	�	�	�	�	�	�	�	�	�	�v�	�	�	�	�	�	��r�1�c�6�4��u�b��-����5��9�9�g�s�H�J�J�@���	/�	/�A��M�M�$�-��*�*�A�.�.�.�.�	/�	/rc���ddgdg}tj|��}|�||��|�||��|�|d|d��dS�NrTr�r�r�rr"rr�rs   r�test_deepcopy_listzTestCopy.test_deepcopy_listm�n����V�Q�K���M�!��������A��������A��������1��q��t�$�$�$�$�$rc�T�g}|�|��tj|��}tD]}|�t
|||��� |�||��|�|d|��|�t|��d��dSr%)
rWrr"�comparisonsrI�RecursionErrorr�rr�len�rrr �ops    r�test_deepcopy_reflexive_listz%TestCopy.test_deepcopy_reflexive_listts�����	��������M�!�����	8�	8�B����n�b�!�Q�7�7�7�7�����A�����
�
�a��d�A��������Q����#�#�#�#�#rc�^�d}tj|��}|�||��dS�NrC�rr"rrs   r�test_deepcopy_empty_tuplez"TestCopy.test_deepcopy_empty_tuple~s0�����M�!�����
�
�a������rc���ddgdf}tj|��}|�||��|�||��|�|d|d��dSrWrXrs   r�test_deepcopy_tuplezTestCopy.test_deepcopy_tuple�rZrc�^�d}tj|��}|�||��dS)N)�rTr�r�rdrs   r�!test_deepcopy_tuple_of_immutablesz*TestCopy.test_deepcopy_tuple_of_immutables�s0�����M�!�����
�
�a������rc�l�gf}|d�|��tj|��}tD]}|�t
|||��� |�||��|�|d|d��|�|dd|��dS�Nr)rWrr"r\rIr]r�rr_s    r�test_deepcopy_reflexive_tuplez&TestCopy.test_deepcopy_reflexive_tuple�s���
�E��	�!����A�����M�!�����	8�	8�B����n�b�!�Q�7�7�7�7�����A��������1��q��t�$�$�$��
�
�a��d�1�g�q�!�!�!�!�!rc���ddgdd�}tj|��}|�||��|�||��|�|d|d��dS)NrTr�r�r�r'rXrs   r�test_deepcopy_dictzTestCopy.test_deepcopy_dict�sr����F�1�%�%���M�!��������A��������A��������5��1�U�8�,�,�,�,�,rc��i}||d<tj|��}tD]}|�t|||��� t
D]}|�t|||��� |�||��|�|d|��|�	t|��d��dS)Nr'rT)rr"�order_comparisonsrIrJ�equality_comparisonsr]r�rrr^r_s    r�test_deepcopy_reflexive_dictz%TestCopy.test_deepcopy_reflexive_dict�s�������%���M�!����#�	3�	3�B����i��Q��2�2�2�2�&�	8�	8�B����n�b�!�Q�7�7�7�7�����A�����
�
�a��h��"�"�"�����Q����#�#�#�#�#rc��i}g}tj||��}|�|t|��d|��dSrl)rr"r�id�rr5rr s    r�test_deepcopy_keepalivez TestCopy.test_deepcopy_keepalive�sF�������M�!�T�"�"���
�
�d�2�d�8�8�n�Q�'��+�+�+�+�+rc�T�i}gd�}tj||��}|�||��|�t|��d��i}dg}tj||��}|�||��|�t|��d��dS)N)rTr�r��r�ri)rr"rr^rvs    r�!test_deepcopy_dont_memo_immutablez*TestCopy.test_deepcopy_dont_memo_immutable�s������L�L���M�!�T�"�"������A��������T���A�&�&�&���
�H���M�!�T�"�"������A��������T���A�&�&�&�&�&rc���Gd�d��}|dg��}tj|��}|�||��|�|j|j��dS)Nc��eZdZd�Zd�ZdS)�.TestCopy.test_deepcopy_inst_vanilla.<locals>.Cc��||_dSr
r&r(s  rr)z7TestCopy.test_deepcopy_inst_vanilla.<locals>.C.__init__�r*rc�"�|j|jkSr
r&r�s  rr�z5TestCopy.test_deepcopy_inst_vanilla.<locals>.C.__eq__�r�rNr�rCrrr-r}�r�rr-r�rr"rr�r'r�s    r�test_deepcopy_inst_vanillaz#TestCopy.test_deepcopy_inst_vanilla�s���	-�	-�	-�	-�	-�	-�	-�	-�

�A�r�d�G�G���M�!��������A�����������&�&�&�&�&rc���G�fd�d����dg��}tj|��}|�||��|�||��|�|j|j��dS)Nc�&��eZdZd�Z�fd�Zd�ZdS)�/TestCopy.test_deepcopy_inst_deepcopy.<locals>.Cc��||_dSr
r&r(s  rr)z8TestCopy.test_deepcopy_inst_deepcopy.<locals>.C.__init__�r*rc�J���tj|j|����Sr
)rr"r'r4s  �rr6z<TestCopy.test_deepcopy_inst_deepcopy.<locals>.C.__deepcopy__�s!����q���t�x��6�6�7�7�7rc�"�|j|jkSr
r&r�s  rr�z6TestCopy.test_deepcopy_inst_deepcopy.<locals>.C.__eq__�r�rN)r0r1r2r)r6r�r3s�rr-r��sL�������
�
�
�
8�
8�
8�
8�
8�
-�
-�
-�
-�
-rr-rr�r6s   @r�test_deepcopy_inst_deepcopyz$TestCopy.test_deepcopy_inst_deepcopy�s����	-�	-�	-�	-�	-�	-�	-�	-�	-�	-�
�A�r�d�G�G���M�!��������A��������A�����������&�&�&�&�&rc��Gd�d��}|dg��}tj|��}|�||��|�||��|�|j|j��dS)Nc� �eZdZd�Zd�Zd�ZdS)�2TestCopy.test_deepcopy_inst_getinitargs.<locals>.Cc��||_dSr
r&r(s  rr)z;TestCopy.test_deepcopy_inst_getinitargs.<locals>.C.__init__�r*rc��|jfSr
r&rs rr�zBTestCopy.test_deepcopy_inst_getinitargs.<locals>.C.__getinitargs__�r�rc�"�|j|jkSr
r&r�s  rr�z9TestCopy.test_deepcopy_inst_getinitargs.<locals>.C.__eq__�r�rNr�rCrrr-r��r�rr-rr�r�s    r�test_deepcopy_inst_getinitargsz'TestCopy.test_deepcopy_inst_getinitargs����	-�	-�	-�	-�	-�	-�	-�	-�
�A�r�d�G�G���M�!��������A��������A�����������&�&�&�&�&rc�p�Gd�dt��}|dg��}tj|��}|�||��|�||��|�||��|�|j|j��|�|j|j��dS)Nc� �eZdZd�Zd�Zd�ZdS)�1TestCopy.test_deepcopy_inst_getnewargs.<locals>.Cc�H�t�|��}||_|Sr
r�r�s   rr=z9TestCopy.test_deepcopy_inst_getnewargs.<locals>.C.__new__�r�rc��|jfSr
r&rs rr�z@TestCopy.test_deepcopy_inst_getnewargs.<locals>.C.__getnewargs__�r�rc�"�|j|jkSr
r&r�s  rr�z8TestCopy.test_deepcopy_inst_getnewargs.<locals>.C.__eq__�r�rNr�rCrrr-r��r�rr-r�r�rr"r�rr�r'r�s    r�test_deepcopy_inst_getnewargsz&TestCopy.test_deepcopy_inst_getnewargs�s���	-�	-�	-�	-�	-��	-�	-�	-�
�A�r�d�G�G���M�!�������a��#�#�#�����A��������A�����������&�&�&��������&�&�&�&�&rc�r�Gd�dt��}|dg���}tj|��}|�||��|�||��|�||��|�|j|j��|�|j|j��dS)Nc� �eZdZd�Zd�Zd�ZdS)�4TestCopy.test_deepcopy_inst_getnewargs_ex.<locals>.Cc�H�t�|��}||_|Sr
r�r�s   rr=z<TestCopy.test_deepcopy_inst_getnewargs_ex.<locals>.C.__new__�r�rc��dd|jifSr�r&rs rr�zFTestCopy.test_deepcopy_inst_getnewargs_ex.<locals>.C.__getnewargs_ex__r�rc�"�|j|jkSr
r&r�s  rr�z;TestCopy.test_deepcopy_inst_getnewargs_ex.<locals>.C.__eq__r�rNr�rCrrr-r��r�rr-rr&r�r�s    r� test_deepcopy_inst_getnewargs_exz)TestCopy.test_deepcopy_inst_getnewargs_ex�s���	-�	-�	-�	-�	-��	-�	-�	-�
�A�2�$�K�K�K���M�!�������a��#�#�#�����A��������A�����������&�&�&��������&�&�&�&�&rc��Gd�d��}|dg��}tj|��}|�||��|�||��|�|j|j��dS)Nc� �eZdZd�Zd�Zd�ZdS)�/TestCopy.test_deepcopy_inst_getstate.<locals>.Cc��||_dSr
r&r(s  rr)z8TestCopy.test_deepcopy_inst_getstate.<locals>.C.__init__r*rc��d|jiSrr&rs rrz<TestCopy.test_deepcopy_inst_getstate.<locals>.C.__getstate__rrc�"�|j|jkSr
r&r�s  rr�z6TestCopy.test_deepcopy_inst_getstate.<locals>.C.__eq__r�rNrrCrrr-r�
rrr-rr�r�s    r�test_deepcopy_inst_getstatez$TestCopy.test_deepcopy_inst_getstater�rc��Gd�d��}|dg��}tj|��}|�||��|�||��|�|j|j��dS)Nc� �eZdZd�Zd�Zd�ZdS)�/TestCopy.test_deepcopy_inst_setstate.<locals>.Cc��||_dSr
r&r(s  rr)z8TestCopy.test_deepcopy_inst_setstate.<locals>.C.__init__r*rc� �|d|_dSrr&r
s  rrz<TestCopy.test_deepcopy_inst_setstate.<locals>.C.__setstate__rrc�"�|j|jkSr
r&r�s  rr�z6TestCopy.test_deepcopy_inst_setstate.<locals>.C.__eq__ r�rNrrCrrr-r�rrr-rr�r�s    r�test_deepcopy_inst_setstatez$TestCopy.test_deepcopy_inst_setstater�rc���Gd�d��}|dg��}tj|��}|�||��|�||��|�|j|j��|g��}tj|��}|�||��|�||��|�|j|j��dS)Nc�&�eZdZd�Zd�Zd�Zd�ZdS)�8TestCopy.test_deepcopy_inst_getstate_setstate.<locals>.Cc��||_dSr
r&r(s  rr)zATestCopy.test_deepcopy_inst_getstate_setstate.<locals>.C.__init__*r*rc��|jSr
r&rs rrzETestCopy.test_deepcopy_inst_getstate_setstate.<locals>.C.__getstate__,rrc��||_dSr
r&r
s  rrzETestCopy.test_deepcopy_inst_getstate_setstate.<locals>.C.__setstate__.rrc�"�|j|jkSr
r&r�s  rr�z?TestCopy.test_deepcopy_inst_getstate_setstate.<locals>.C.__eq__0r�rNrrCrrr-r�)rrr-rr�r�s    r�$test_deepcopy_inst_getstate_setstatez-TestCopy.test_deepcopy_inst_getstate_setstate(s���	-�	-�	-�	-�	-�	-�	-�	-�
�A�r�d�G�G���M�!��������A��������A�����������&�&�&�
�A�b�E�E���M�!��������A��������A�����������&�&�&�&�&rc���Gd�d��}|��}||_tj|��}|�||��|�|j|��dS)Nc��eZdZdS)�0TestCopy.test_deepcopy_reflexive_inst.<locals>.CNr�rCrrr-r�?r�rr-)r'rr"r�rr�s    r�test_deepcopy_reflexive_instz%TestCopy.test_deepcopy_reflexive_inst>s}��	�	�	�	�	�	�	�	�
�A�C�C������M�!��������A�����
�
�a�e�Q�����rc���Gd�dt��}|��}tj|��}|�||��tj|��}|�||��dS)Nc��eZdZd�ZdS)�+TestCopy.test_reconstruct_string.<locals>.Cc��dS)NrUrCrs rraz6TestCopy.test_reconstruct_string.<locals>.C.__reduce__Ks���rrNrnrCrrr-r�Js#������
�
�
�
�
rr-)r4rrr"r�s    r�test_reconstruct_stringz TestCopy.test_reconstruct_stringIs���	�	�	�	�	��	�	�	�
�A�C�C���I�a�L�L���
�
�a������M�!�����
�
�a������rc�$��G�fd�dt������}d|_tj|��}|�|j|j��tj|��}|�|j|j��dS)Nc���eZdZ�fd�ZdS)�,TestCopy.test_reconstruct_nostate.<locals>.Cc����dfSrcrCr,s �rraz7TestCopy.test_reconstruct_nostate.<locals>.C.__reduce__Us����2�w�rNrnr3s�rr-r�Ts.�������
�
�
�
�
�
�
rr-r)r4r'rrr5r"r6s   @r�test_reconstruct_nostatez!TestCopy.test_reconstruct_nostateSs����	�	�	�	�	�	�	��	�	�	�
�A�C�C������I�a�L�L���
�
�a�k�1�;�/�/�/��M�!�����
�
�a�k�1�;�/�/�/�/�/rc�>��G�fd�dt������}dg|_tj|��}|�||��tj|��}|�||��|�|j|j��dS)Nc� ��eZdZ�fd�Zd�ZdS)�*TestCopy.test_reconstruct_state.<locals>.Cc����d|jfSrc��__dict__r,s �rraz5TestCopy.test_reconstruct_state.<locals>.C.__reduce__`�����2�t�}�-�-rc�"�|j|jkSr
r�r�s  rr�z1TestCopy.test_reconstruct_state.<locals>.C.__eq__b����}���6�6rN�r0r1r2rar�r3s�rr-r�_s=�������
.�
.�
.�
.�
.�
7�
7�
7�
7�
7rr-r�r4r'rrr"r�r6s   @r�test_reconstruct_statezTestCopy.test_reconstruct_state^s����	7�	7�	7�	7�	7�	7�	7��	7�	7�	7�

�A�C�C�������I�a�L�L������A�����M�!��������A�����������&�&�&�&�&rc�>��G�fd�dt������}dg|_tj|��}|�||��tj|��}|�||��|�|j|j��dS)Nc�&��eZdZ�fd�Zd�Zd�ZdS)�3TestCopy.test_reconstruct_state_setstate.<locals>.Cc����d|jfSrcr�r,s �rraz>TestCopy.test_reconstruct_state_setstate.<locals>.C.__reduce__nr�rc�:�|j�|��dSr
)r��updater
s  rrz@TestCopy.test_reconstruct_state_setstate.<locals>.C.__setstate__ps���
�$�$�U�+�+�+�+�+rc�"�|j|jkSr
r�r�s  rr�z:TestCopy.test_reconstruct_state_setstate.<locals>.C.__eq__rr�rN)r0r1r2rarr�r3s�rr-r�msL�������
.�
.�
.�
.�
.�
,�
,�
,�
7�
7�
7�
7�
7rr-rr�r6s   @r�test_reconstruct_state_setstatez(TestCopy.test_reconstruct_state_setstatels����	7�	7�	7�	7�	7�	7�	7��	7�	7�	7�
�A�C�C�������I�a�L�L������A�����M�!��������A�����������&�&�&�&�&rc���Gd�dt��}|��}||_tj|��}|�||��|�|j|��dS)Nc��eZdZdS)�.TestCopy.test_reconstruct_reflexive.<locals>.CNr�rCrrr-r�}r�rr-)r4r'rr"r�rr�s    r�test_reconstruct_reflexivez#TestCopy.test_reconstruct_reflexive|s��	�	�	�	�	��	�	�	�
�A�C�C������M�!��������A�����
�
�a�e�Q�����rc����G�fd�dt����ddgdg��}tj|��}|�||��|�||��|�|d|d��tj|��}|�||��|�||��|�|d|d��dS)Nc� ��eZdZ�fd�Zd�ZdS)�&TestCopy.test_reduce_4tuple.<locals>.Cc�4���d|jt|��fSrc)r��iterr,s �rraz1TestCopy.test_reduce_4tuple.<locals>.C.__reduce__�s����2�t�}�d�4�j�j�9�9rc�b�t|��t|��ko|j|jkSr
)�listr�r�s  rr�z-TestCopy.test_reduce_4tuple.<locals>.C.__eq__��,���T�
�
�d�5�k�k�1�8��
���7�9rNr�r3s�rr-r��s=�������
:�
:�
:�
:�
:�
9�
9�
9�
9�
9rr-rTr�r�r)r�rrr�rr"r6s   @r�test_reduce_4tuplezTestCopy.test_reduce_4tuple�s���	9�	9�	9�	9�	9�	9�	9��	9�	9�	9�
�A��1�v�q�k�N�N���I�a�L�L������A��������A�����
�
�a��d�A�a�D�!�!�!��M�!��������A��������A��������1��q��t�$�$�$�$�$rc����G�fd�dt����dddgfdg��}tj|��}|�||��|�||��|�|d|d��tj|��}|�||��|�||��|�|d|d��dS)Nc� ��eZdZ�fd�Zd�ZdS)�&TestCopy.test_reduce_5tuple.<locals>.Cc�@���d|jd|���fSrc)r��itemsr,s �rraz1TestCopy.test_reduce_5tuple.<locals>.C.__reduce__�s����2�t�}�d�D�J�J�L�L�A�Arc�b�t|��t|��ko|j|jkSr
)�dictr�r�s  rr�z-TestCopy.test_reduce_5tuple.<locals>.C.__eq__�r�rNr�r3s�rr-r��sB�������
B�
B�
B�
B�
B�
9�
9�
9�
9�
9rr-r'rTr�)r�r�)r�rrr�rr"r6s   @r�test_reduce_5tuplezTestCopy.test_reduce_5tuple�s	���	9�	9�	9�	9�	9�	9�	9��	9�	9�	9�
�A���1�v��
�+�,�,���I�a�L�L������A��������A�����
�
�a��h��%��)�)�)��M�!��������A��������A��������5��1�U�8�,�,�,�,�,rc�d�����fd��G��fd�d������}��t��5tj|��ddd��n#1swxYwY��t��5tj|��ddd��dS#1swxYwYdS)Nc�2����d��dSr^r_)�args�kwargsrs  �r�state_setterz1TestCopy.test_reduce_6tuple.<locals>.state_setter�s����I�I�+�,�,�,�,�,rc���eZdZ��fd�ZdS)�&TestCopy.test_reduce_6tuple.<locals>.Cc����d|jdd�fSrcr�)rr-r�s ��rraz1TestCopy.test_reduce_6tuple.<locals>.C.__reduce__�s����"�d�m�T�4��E�ErNrn)r-r�s��rr-r��s;�������
F�
F�
F�
F�
F�
F�
F�
Frr-�rIrJrr")rrr-r�s` @@r�test_reduce_6tuplezTestCopy.test_reduce_6tuple�sk�����	-�	-�	-�	-�	-�	F�	F�	F�	F�	F�	F�	F�	F�	F�	F�	F�
�A�C�C��
�
�
�y�
)�
)�	�	��I�a�L�L�L�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�
�
�
�y�
)�
)�	�	��M�!����	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s#�A�A"�%A"�B%�%B)�,B)c�T��G�fd�d������}|�t��5tj|��ddd��n#1swxYwY|�t��5tj|��ddd��dS#1swxYwYdS)Nc���eZdZ�fd�ZdS)�+TestCopy.test_reduce_6tuple_none.<locals>.Cc����d|jdddfSrcr�r,s �rraz6TestCopy.test_reduce_6tuple_none.<locals>.C.__reduce__�s����"�d�m�T�4��=�=rNrnr3s�rr-r��s.�������
>�
>�
>�
>�
>�
>�
>rr-r�r�s  @r�test_reduce_6tuple_nonez TestCopy.test_reduce_6tuple_none�s@���	>�	>�	>�	>�	>�	>�	>�	>�	>�	>�
�A�C�C��
�
�
�y�
)�
)�	�	��I�a�L�L�L�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�
�
�
�y�
)�
)�	�	��M�!����	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s#�A�A�A�;B�B!�$B!c��Gd�dt��}|��}dg|_tj|��}|�|j|j��dS)Nc��eZdZdgZdS)�#TestCopy.test_copy_slots.<locals>.Cr'N�r0r1r2�	__slots__rCrrr-r�����������I�I�Irr-r)r4r'rrr�s    r�test_copy_slotszTestCopy.test_copy_slots�sk��	 �	 �	 �	 �	 ��	 �	 �	 �
�A�C�C�������I�a�L�L���
�
�a�e�Q�U�#�#�#�#�#rc��Gd�dt��}|��}dg|_tj|��}|�|j|j��|�|j|j��dS)Nc��eZdZdgZdS)�'TestCopy.test_deepcopy_slots.<locals>.Cr'Nr�rCrrr-r�rrr-r)r4r'rr"rr�r�s    r�test_deepcopy_slotszTestCopy.test_deepcopy_slots�s���	 �	 �	 �	 �	 ��	 �	 �	 �
�A�C�C�������M�!�����������&�&�&��������&�&�&�&�&rc�~�Gd�dt��}|ddi���}tj|��}|�||��|�|j|j��|�||��d|d<|�||��|�|j|j��dS)Nc�*��eZdZd�fd�	Z�fd�Z�xZS)�/TestCopy.test_deepcopy_dict_subclass.<locals>.CNc���|si}t|�����|_t���|��dSr
)r��keys�_keys�superr))r�dr5s  �rr)z8TestCopy.test_deepcopy_dict_subclass.<locals>.C.__init__�sC������A�!�!�&�&�(�(�^�^��
���� � ��#�#�#�#�#rc���t���||��||jvr|j�|��dSdSr
)r
�__setitem__rrW)r�key�itemr5s   �rrz;TestCopy.test_deepcopy_dict_subclass.<locals>.C.__setitem__�sR������#�#�C��.�.�.��d�j�(�+��J�%�%�c�*�*�*�*�*�+�+rr
)r0r1r2r)r�
__classcell__)r5s@rr-r	�sV�������
$�
$�
$�
$�
$�
$�

+�
+�
+�
+�
+�
+�
+�
+�
+rr-r'r)rrTr�)r�rr"rrr��assertNotEqualr�s    r�test_deepcopy_dict_subclassz$TestCopy.test_deepcopy_dict_subclass�s���		+�		+�		+�		+�		+��		+�		+�		+�
�A��q�	�N�N�N���M�!��������A���������!�'�*�*�*�����A������%�����A�q�!�!�!����A�G�Q�W�-�-�-�-�-rc��Gd�dt��}|ddgdg��}ddg|_tj|��}|�t|��t|����|�|j|j��|�|d|d��|�|j|j��dS)	Nc��eZdZdS)�+TestCopy.test_copy_list_subclass.<locals>.CNr�rCrrr-r�r�rr-rTr�r�ry�r)r�r'rrrr�s    r�test_copy_list_subclassz TestCopy.test_copy_list_subclass�s���	�	�	�	�	��	�	�	�
�A��1�v�q�k�N�N���A�����I�a�L�L������a���$�q�'�'�*�*�*��������&�&�&��
�
�a��d�A�a�D�!�!�!��
�
�a�e�Q�U�#�#�#�#�#rc��Gd�dt��}|ddgdg��}ddg|_tj|��}|�t|��t|����|�|j|j��|�|d|d��|�|j|j��dS)	Nc��eZdZdS)�/TestCopy.test_deepcopy_list_subclass.<locals>.CNr�rCrrr-r�r�rr-rTr�r�ryrr)r�r'rr"rr�r�s    r�test_deepcopy_list_subclassz$TestCopy.test_deepcopy_list_subclass�s���	�	�	�	�	��	�	�	�
�A��1�v�q�k�N�N���A�����M�!��������a���$�q�'�'�*�*�*��������&�&�&�����1��q��t�$�$�$��������&�&�&�&�&rc��Gd�dt��}|gd���}|�t|��d��tj|��}|�t|��d��dS)Nc��eZdZdS)�,TestCopy.test_copy_tuple_subclass.<locals>.CNr�rCrrr-r!�r�rr-r�)�tuplerrr�s    r�test_copy_tuple_subclassz!TestCopy.test_copy_tuple_subclass�s���	�	�	�	�	��	�	�	�
�A�i�i�i�L�L������q���9�-�-�-��I�a�L�L������q���9�-�-�-�-�-rc�~�Gd�dt��}|ddgdg��}|�t|��ddgdf��tj|��}|�t|��ddgdf��|�||��|�|d|d��dS)Nc��eZdZdS)�0TestCopy.test_deepcopy_tuple_subclass.<locals>.CNr�rCrrr-r&r�rr-rTr�r�r)r"rrr"r�r�s    r�test_deepcopy_tuple_subclassz%TestCopy.test_deepcopy_tuple_subclasss���	�	�	�	�	��	�	�	�
�A��1�v�q�k�N�N������q���Q��F�A�;�/�/�/��M�!��������q���Q��F�A�;�/�/�/�����A��������1��q��t�$�$�$�$�$rc��Gd�dt��}|�ttj|����dS)Nc��eZdZd�ZdS)�-TestCopy.test_getstate_exc.<locals>.EvilStatec� �td���)Nzain't got no stickin' state)�
ValueErrorrs rrz:TestCopy.test_getstate_exc.<locals>.EvilState.__getstate__s�� �!>�?�?�?rN)r0r1r2rrCrr�	EvilStater*
s(������
@�
@�
@�
@�
@rr-)r4rIr,r)rr-s  r�test_getstate_exczTestCopy.test_getstate_excs\��	@�	@�	@�	@�	@��	@�	@�	@�	
���*�d�i�����=�=�=�=�=rc��|�tjt��t��d�}|�tj|��|��d�}|�tj|��|��dS)Nc��||zSr
rC�rr s  rr'z(TestCopy.test_copy_function.<locals>.foo�
��a��c�zrc��dSr
rCrCrr�<lambda>z-TestCopy.test_copy_function.<locals>.<lambda>���d�r)rr�
global_foo�rr'r�s   r�test_copy_functionzTestCopy.test_copy_functionst�������:�.�.�
�;�;�;�!�!�!������3����-�-�-��l�������3����-�-�-�-�-rc��|�tjt��t��d�}|�tj|��|��d�}|�tj|��|��dS)Nc��||zSr
rCr1s  rr'z,TestCopy.test_deepcopy_function.<locals>.foor2rc��dSr
rCrCrrr4z1TestCopy.test_deepcopy_function.<locals>.<lambda>r5r)rrr"r6r7s   r�test_deepcopy_functionzTestCopy.test_deepcopy_functionsx�������z�2�2�J�?�?�?�!�!�!������s�+�+�S�1�1�1��l�������s�+�+�S�1�1�1�1�1rc���Gd�dt��}|��}tj|��}||��}|�||��~||��}|�||��dS)Nc��eZdZdS)�"TestCopy._check_weakref.<locals>.CNr�rCrrr-r?!r�rr-)r4�weakref�refr)r�_copyr-r@rr s      r�_check_weakrefzTestCopy._check_weakref s���	�	�	�	�	��	�	�	��a�c�c���K������E�!�H�H���
�
�a�������E�!�H�H���
�
�a������rc�D�|�tj��dSr
)rCrrs r�test_copy_weakrefzTestCopy.test_copy_weakref+s�����D�I�&�&�&�&�&rc�D�|�tj��dSr
)rCrr"rs r�test_deepcopy_weakrefzTestCopy.test_deepcopy_weakref.s�����D�M�*�*�*�*�*rc��
�Gd�dt���
�
fd�td��D��\}}}}|��}|||<|||<tj|��}|�||��|�||��|�|||��|�|||��|�t|��d��~~t
j��|�t|��d���
���
��}	}|	||<|�||��dS)Nc��eZdZdS)�(TestCopy._check_copy_weakdict.<locals>.CNr�rCrrr-rJ2r�rr-c�$��g|]}�����
SrCrC��.0�ir-s  �r�
<listcomp>z1TestCopy._check_copy_weakdict.<locals>.<listcomp>4s���,�,�,�a�a�a�c�c�,�,�,rryr�rT)	r4r�rr�rr^r	�
gc_collect�assertNotIn)r�	_dicttype�a�brZr�u�vrr r-s          @r�_check_copy_weakdictzTestCopy._check_copy_weakdict1sd���	�	�	�	�	��	�	�	�,�,�,�,�5��8�8�,�,�,�
��1�a���I�K�K����!����!���I�a�L�L������A��������A��������1��q�!�!�!�����1��q�!�!�!�����Q����#�#�#�
�q����������Q����#�#�#��q�s�s�A�A�C�C�1����!������A�����rc�D�|�tj��dSr
)rWr@�WeakKeyDictionaryrs r�test_copy_weakkeydictzTestCopy.test_copy_weakkeydictFs���!�!�'�";�<�<�<�<�<rc�D�|�tj��dSr
)rWr@�WeakValueDictionaryrs r�test_copy_weakvaluedictz TestCopy.test_copy_weakvaluedictIs���!�!�'�"=�>�>�>�>�>rc���Gd�dt����fd�td��D��\}}}}tj��}|||<|||<t	j|��}|�||��|�t|��d��|�	|||��|�	|||��|�||j
|j
��|�||j
|j
��~tj��|�t|��d��dS)Nc��eZdZd�ZdS)�-TestCopy.test_deepcopy_weakkeydict.<locals>.Cc��||_dSr
�rN�rrNs  rr)z6TestCopy.test_deepcopy_weakkeydict.<locals>.C.__init__N�
������rN�r0r1r2r)rCrrr-r`M�#������
�
�
�
�
rr-c�&��g|]
}�|����SrCrCrLs  �rrOz6TestCopy.test_deepcopy_weakkeydict.<locals>.<listcomp>P�!���-�-�-�q�a�a��d�d�-�-�-rryr�rT)
r4r�r@rYrr"rrr^r�rNr	rP)rrSrTrZrrUrVr-s       @r�test_deepcopy_weakkeydictz"TestCopy.test_deepcopy_weakkeydictLs[���	�	�	�	�	��	�	�	�.�-�-�-�E�!�H�H�-�-�-�
��1�a���%�'�'����!����!���M�!�������A�q�!�!�!�����Q����#�#�#�����1��q�!�!�!�����1��q�!�!�!�����1�����%�%�%�����1�����%�%�%�
����������Q����#�#�#�#�#rc�B��Gd�dt����fd�td��D��\}}}}tj��}|||<|||<t	j|��}|�||��|�t|��d��t|�
��d����\\}}\}	}
|�||��|�|j|j��|�
||��|�|	|��|�|	j|j��|�
|
|��~~~	~
~tj��|�t|��d��dS)	Nc��eZdZd�ZdS)�/TestCopy.test_deepcopy_weakvaluedict.<locals>.Cc��||_dSr
rbrcs  rr)z8TestCopy.test_deepcopy_weakvaluedict.<locals>.C.__init__brdrNrerCrrr-rlarfrr-c�&��g|]
}�|����SrCrCrLs  �rrOz8TestCopy.test_deepcopy_weakvaluedict.<locals>.<listcomp>drhrryr�c��|djSrlrb)�pairs rr4z6TestCopy.test_deepcopy_weakvaluedict.<locals>.<lambda>ls��D��G�I�r)rrT)r4r�r@r\rr"rrr^�sortedr�r�rNrr	rP)rrSrTrZrrUrVrr �z�tr-s           @r�test_deepcopy_weakvaluedictz$TestCopy.test_deepcopy_weakvaluedict`s����	�	�	�	�	��	�	�	�.�-�-�-�E�!�H�H�-�-�-�
��1�a���'�)�)����!����!���M�!�������A�q�!�!�!�����Q����#�#�#�����	�	�/E�/E�F�F�F����A���A�����A���������a�c�"�"�"��
�
�a���������A���������a�c�"�"�"��
�
�a�����
�q�!�Q�
����������Q����#�#�#�#�#rc�(�Gd�dt��}|��}|j|_tj|��}|�|j|j��|�|jj|��|���dS)Nc��eZdZd�ZdS)�0TestCopy.test_deepcopy_bound_method.<locals>.Fooc��dSr
rCrs r�mz2TestCopy.test_deepcopy_bound_method.<locals>.Foo.mzs���rN)r0r1r2ryrCrr�Foorwys#������
�
�
�
�
rrz)r4ryrTrr"rr�__self__)rrzr��gs    r�test_deepcopy_bound_methodz#TestCopy.test_deepcopy_bound_methodxs���	�	�	�	�	�&�	�	�	�
�C�E�E���c����M�!���������a�c�"�"�"��
�
�a�c�l�A�&�&�&�	�������rN)Qr0r1r2rr!r7rNrhrpr�r�r�r�r�r�r�r�r�r�r�r�r�rrr r#r&r.r7r=rDrIrNrUrYrarergrjrmrorsrwrzr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrr#r'r.r8r<rCrErGrWrZr]rirtr}rCrrrrs�������;�;�;����
	'�	'�	'����!�!�!�	!�	!�	!�4�4�4�+�+�+�"���'�'�'�������'�'�'����*�*�*�	*�	*�	*�	*�	*�	*�'�'�'�"'�'�'�"	*�	*�	*�	*�	*�	*�*�*�*�$���
	"�	"�	"�	.�	.�	.�	'�	'�	'����!�!�!�	!�	!�	!�8�8�8�/�/�/�%�%�%�$�$�$����
%�%�%����
"�"�"�-�-�-�
$�
$�
$�,�,�,�
'�
'�
'�	'�	'�	'�'�'�'�'�'�'�'�'�'�$'�'�'�$'�'�'�'�'�'�'�'�'�, � � ����	0�	0�	0�'�'�'�'�'�'�  � � �%�%�%�"-�-�-�"
�
�
����$�$�$�'�'�'�.�.�.�(	$�	$�	$�	'�	'�	'�.�.�.�%�%�%�>�>�>�.�.�.�2�2�2�	�	�	�'�'�'�+�+�+����*=�=�=�?�?�?�$�$�$�($�$�$�0	�	�	�	�	rrc��||zSr
rCr1s  rr6r6�s
��Q�q�S�jr�__main__)rrKr@r��operatorrrrrrr�unittest�testr	rqrrr\�TestCaserr6r0�mainrCrr�<module>r�s��%�������������
�
�
�
�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�������������B��N���2�v���"6�6��q
�q
�q
�q
�q
�x� �q
�q
�q
�h!� � ��z����H�M�O�O�O�O�O��r