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_dictcomps.cpython-310.pyc
o

�i��@s6ddlZdZGdd�dej�Zedkre��dSdS)�N�Global variablec@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�DictComprehensionTestcCstddddddddd	d
d�
}dd
�td�D�}|�||�ddddddddddd�
}dd
�td�D�}|�||�dS)N�
���
�������
r���������	cSsi|]}||d�qS�r���.0�krr�0/usr/local/lib/python3.10/test/test_dictcomps.py�
<dictcomp>�z5DictComprehensionTest.test_basics.<locals>.<dictcomp>rrrrrrrrrrcSs(i|]}td�D]	}||kr||�qqSr��range�rr�vrrrrs(�r!�assertEqual��self�expected�actualrrr�test_basics	s�z!DictComprehensionTest.test_basicsc
Csfd}ddddddddddd�
}dd�td�D�}|�||�|�|d�idd�dd	�d
d	�dd�d
d�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�idd�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*�d/d*��d*d*dddddddddd0��}d1d�td�D�}|�|d�|�||�dS)2NzLocal VariablercS�i|]}|d�qS�Nrrrrrr�z>DictComprehensionTest.test_scope_isolation.<locals>.<dictcomp>rrrrrr
�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�YcS�*i|]}t|d|d�D]}||�q
qS�rrr )rr#rrrrr"�*r$)r'rr(r)rrr�test_scope_isolations��2��������������������������
�z*DictComprehensionTest.test_scope_isolationc
Csbddddddddddd�
}dd�td�D�}|�||�|�td�idd�dd	�d
d	�dd�d
d�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�idd�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*�d/d*��d*d*dddddddddd0��}d1d�td�D�}|�td�|�||�dS)2NrcSr+r,r)r�grrrr)r-zJDictComprehensionTest.test_scope_isolation_from_global.<locals>.<dictcomp>rrrrrrr
r.rr/r0r1rr2r3r4r5rr6r7r8r9r:rr;r<r=r>r?r@rrArBrCrDrErFrGrrHrIrJrKrLrMcSrYrZr )rr#r]rrrr3r[)r!r%r]r&rrr� test_scope_isolation_from_global&s��2��������������������������
�z6DictComprehensionTest.test_scope_isolation_from_globalcCs<ddddddddddd�
}dd�td�D�}|�||�dS)NrrcSsi|]}|t�qSr)r]rrrrr=r-z@DictComprehensionTest.test_global_visibility.<locals>.<dictcomp>rr$r&rrr�test_global_visibility7s�z,DictComprehensionTest.test_global_visibilitycsPd�ddddddddddd�
}�fdd�td�D�}|�||�|��d�dS)NzLocal variablercsi|]}|��qSrrr�r#rrrGr-z?DictComprehensionTest.test_local_visibility.<locals>.<dictcomp>rr$r&rr`r�test_local_visibility@s�z+DictComprehensionTest.test_local_visibilitycCsv|�td��tddd�Wd�n1swY|�td��tddd�Wd�dS1s4wYdS)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)ZassertRaisesRegex�SyntaxError�compile)r'rrr�test_illegal_assignmentKs���"�z-DictComprehensionTest.test_illegal_assignmentcsZddddd�}gd�}g��fdd���fd	d
�tdd�D�}|�||�|��|�dS)
N�W�o�l�d)�H�erhrg)
)�keyrj)�valuerf)rlrk)rmrg�rlrh)rm�rrn)rmrh)rlrg)rmrics��||f�|Sr,)�append)�posrm)�actual_callsrr�add_callfsz=DictComprehensionTest.test_evaluation_order.<locals>.add_callcs"i|]
\}}�d|��d|��qS)rlrmrr")rsrrrjs��z?DictComprehensionTest.test_evaluation_order.<locals>.<dictcomp>ZHelloZWorld)�zipr%)r'r(Zexpected_callsr)r)rrrsr�test_evaluation_orderTs�
�z+DictComprehensionTest.test_evaluation_ordercCs�ddddd�}dd�td�D�}|�||�dd	d
dd�}d
d�td�D�}|�||�dd	d
dd�}dd�td�D�}|�||�dS)Nrrrr
)rrrrcSsi|]}|d}|||�qS�rr)r�i�jrrrrtszQDictComprehensionTest.test_assignment_idiom_in_comprehensions.<locals>.<dictcomp>rrr�)rrrrcSs*i|]}|d}|d}||||�qSrvr�rrwrxrrrrrwr[cSs,i|]}|d|d}}||||�qS)rrrrzrrrrzs,r$r&rrr�'test_assignment_idiom_in_comprehensionsrsz=DictComprehensionTest.test_assignment_idiom_in_comprehensionscCsPddddd�}|�dd�gtd��D�|�|�dd�gtd��RD�|�dS)	Nrrrr)rrrrcS�i|]}|||�qSrr�rrwrrrrrz>DictComprehensionTest.test_star_expression.<locals>.<dictcomp>cSr|rrr}rrrr�r)r%r!)r'r(rrr�test_star_expression}s$z*DictComprehensionTest.test_star_expressionN)�__name__�
__module__�__qualname__r*r\r^r_rarerur{r~rrrrrs
		r�__main__)Zunittestr]ZTestCaserr�mainrrrr�<module>s|�