HEX
Server: Apache
System: Linux bd12.noc223.com 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64
User: handcraf (1693)
PHP: 8.1.28
Disabled: NONE
Upload Files
File: //opt/alt/python312/lib64/python3.12/test/__pycache__/test_dictcomps.cpython-312.pyc
�

h�e���h�ddlZdZGd�dej�Zedk(rej
�yy)�N�Global variablec�B�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zy
)�DictComprehensionTestc�0�ddddddddd	d
d�
}td�D�cic]}||dz��
}}|j||�dd
ddddddddd�
}td�D��cic]}td�D]}||k(s�	||��
�}}}|j||�ycc}wcc}}w)N�
���
�������
r���������	rrrrrrrrrr��range�assertEqual)�self�expected�k�actual�vs     �:/opt/alt/python312/lib64/python3.12/test/test_dictcomps.py�test_basicsz!DictComprehensionTest.test_basics	s����b�R�B�2�"����b�"��%*�2�Y�/��!�Q��V�)�/��/������*��Q�1��q�Q�1��q�Q�O�� %�b�	�G�1�5��9�G�a��Q��!�Q�$�G�!�G��G������*��0��Hs�
B
�B�0Bc
�N�d}ddddddddddd�
}td�D�cic]}|d��}}|j||�|jd�idd�dd�dd�d	d
�dd
�dd
�d
d�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�idd�dd�dd�dd�dd �d!d �d"d �d#d �d$d �d%d �d&d �d'd(�d)d(�d*d(�d+d(�d,d(�d-d(��d(d(dddddddddd.��}td�D��cic]}t|dz|dz�D]}||���}}}|jd�|j||�ycc}wcc}}w)/NzLocal Variablerrrrrrr�r���$r�%�&�'�-r�.�/�0�1�6r�7�8�9�:�;�?r�@�A�B�C�D�E�Hr�I�J�K�L�M��N�O�Q�R�S�T�U�V�W�X�Yr)rr rr!r"s     r#�test_scope_isolationz*DictComprehensionTest.test_scope_isolationsM�������$�4�D����$�8��#(��9�-�a�!�T�'�-��-������*�����,�-�7�A�q�7�"�a�7��Q�7��A�7�r�1�7�b�!�7�R��7�B��7���7��q�7�"$�a�7�)+�Q�7�02�A�7�79�1�7�>@�!�7�EG��7���7��q�7�"$�a�7�)+�Q�7�02�A�7�79�1�7�>@�!�7�EG��7���7��q�7�#%�a�7�*,�Q�7�13�A�7�8:�1�7�?A�!�7�FH��7���	7��q�	7�'(�Q�A�1�!���q�a�Q�A�7��!&�b�	�H�1�5��Q���B��3G�H�a�!�Q�$�H�!�H��H�����,�-������*��.��Is�
D�!D!c
�Z�ddddddddddd�
}td�D�cic]}|d��}}|j||�|jtd�idd�dd�dd�d	d
�dd
�dd
�d
d�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�idd�dd�dd�dd�dd �d!d �d"d �d#d �d$d �d%d �d&d �d'd(�d)d(�d*d(�d+d(�d,d(�d-d(��d(d(dddddddddd.��}td�D��cic]}t|dz|dz�D]}||���}}}|jtd�|j||�ycc}wcc}}w)/Nrrrrrrrrr&rr'r(r)rr*r+r,r-rr.r/r0r1r2rr3r4r5r6r7r8rr9r:r;r<r=r>r?rr@rArBrCrDrE)rr�g)rrrSr!r"s     r#� test_scope_isolation_from_globalz6DictComprehensionTest.test_scope_isolation_from_global&sH�����$�4�D����$�8��#(��9�-�a�!�T�'�-��-������*�����-�.�7�A�q�7�"�a�7��Q�7��A�7�r�1�7�b�!�7�R��7�B��7���7��q�7�"$�a�7�)+�Q�7�02�A�7�79�1�7�>@�!�7�EG��7���7��q�7�"$�a�7�)+�Q�7�02�A�7�79�1�7�>@�!�7�EG��7���7��q�7�#%�a�7�*,�Q�7�13�A�7�8:�1�7�?A�!�7�FH��7���	7��q�	7�'(�Q�A�1�!���q�a�Q�A�7��!&�b�	�H�1�5��Q���B��3G�H�a�!�Q�$�H�!�H��H�����-�.������*��.��Is�
D"�!D'c��ddddddddddd�
}td�D�cic]	}|t��}}|j||�ycc}w)Nrrr)rrSr)rrr r!s    r#�test_global_visibilityz,DictComprehensionTest.test_global_visibility7sZ��(�->�(�->�(�->�(�->�(�->�	@��
!&�b�	�*�1�!�Q�$�*��*������*��+s�>c��d}ddddddddddd�
}td�D�cic]}||��}}|j||�|j|d�ycc}w)NzLocal variablerrr)rr"rr r!s     r#�test_local_visibilityz+DictComprehensionTest.test_local_visibility@so����'�,<�'�,<�'�,<�'�,<�'�,<�	>��
!&�b�	�*�1�!�Q�$�*��*������*�����,�-��+s�
Ac���|jtd�5tddd�ddd�|jtd�5tddd�ddd�y#1swY�6xYw#1swYyxYw)Nz
cannot assignz'{x: y for y, x in ((1, 2), (3, 4))} = 5z<test>�execzillegal expressionz({x: y for y, x in ((1, 2), (3, 4))} += 5)�assertRaisesRegex�SyntaxError�compile)rs r#�test_illegal_assignmentz-DictComprehensionTest.test_illegal_assignmentKst��
�
#�
#�K��
A�	��=�x��
�	��
#�
#�K�1E�
F�	��>���
�	�	�		�	��	�	�s�A�A&�A#�&A/c	����ddddd�}gd�}g��fd�}tdd	�D��cic]\}}|d
|�|d|���}}}|j||�|j�|�ycc}}w)N�W�o�l�d)�H�erbra)
)�keyrd)�valuer`)rfre)rgra�rfrb)rg�rrh)rgrb)rfra)rgrcc�.���j||f�|S)N)�append)�posrg�actual_callss  �r#�add_callz=DictComprehensionTest.test_evaluation_order.<locals>.add_callfs�������e��-��L��Hello�Worldrfrg)�zipr)rr�expected_callsrnr r"r!rms       @r#�test_evaluation_orderz+DictComprehensionTest.test_evaluation_orderTs��������	
��
����	��G�W�-�
���1�
�U�A����!� 4�4�
��
�
	
�����*�����~�6��

s�A&c��ddddd�}td�D��cic]
}|dz}|||z��}}}|j||�dddd	d
�}td�D���cic]}|dz}|dz}||z||z��}}}}|j||�dddd	d
�}td�D���cic]}|dz|dz}}||z||z��}}}}|j||�ycc}}wcc}}}wcc}}}w)Nrrrr
)rrrrrrr	�)rrrrr)rr�i�jr!r s      r#�'test_assignment_idiom_in_comprehensionsz=DictComprehensionTest.test_assignment_idiom_in_comprehensionsrs���Q�1��,��"'��(�:�Q�Q�q�S�q�!�Q�q�S�&�!�:��:������*��Q�2�"�-��$)�!�H�K�K�q�q��s��a��c��!�A�#�q��s�(�#�K��K������*��Q�2�"�-��$)�!�H�G�G�q�A�a�C��1��Q�!�!�A�#�q��s�(�#�G��G������*��;��L��Hs�C
�C�Cc���ddddd�}|jgtd��D�cic]}|||z��
c}|�|jgtd���D�cic]}|||z��
c}|�ycc}wcc}w)Nrrrr)rrrr)rr)rrrws   r#�test_star_expressionz*DictComprehensionTest.test_star_expression}sn���Q�1��+�����+�E�!�H�+�6�Q�!�Q�q�S�&�6��A����,�E�!�H�,�7�Q�!�Q�q�S�&�7��B��7��7s�
A(�
A-N)�__name__�
__module__�__qualname__r$rQrTrVrXr^rtryr{�ror#rrs0��+�+�&+�"+�	.��7�<	+�Cror�__main__)�unittestrS�TestCaserr|�mainrror#�<module>r�s@�����yC�H�-�-�yC�x�z���H�M�M�O�ro