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.7/test/__pycache__/test_dictcomps.cpython-37.opt-2.pyc
B

��g��@s2ddlZdZGdd�dej�Zedkr.e��dS)�NzGlobal variablec@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�DictComprehensionTestcCstddddddddd	d
d�
}dd
�td�D�}|�||�ddddddddddd�
}dd
�td�D�}|�||�dS)N�
���
������)
r���������	cSsi|]}|d|�qS)r�)�.0�krr�//usr/local/lib/python3.7/test/test_dictcomps.py�
<dictcomp>sz5DictComprehensionTest.test_basics.<locals>.<dictcomp>rr
rrrrrrrrcSs(i|] }td�D]}||kr||�qqS)r)�range)rr�vrrrrs)r�assertEqual)�self�expected�actualrrr�test_basics	s
z!DictComprehensionTest.test_basicsc.Cs�d}ddddddddddd�
}dd�td�D�}|�||�|�|d�ddddddd	d	d	d	d
d
d
d
d
dddddddddddddd
d
d
d
d
d
d
d
dddddddddd�-}dd�td�D�}|�|d�|�||�dS)NzLocal Variable)
rr
rrrrrrrrcSsi|]
}d|�qS)Nr)rrrrrrsz>DictComprehensionTest.test_scope_isolation.<locals>.<dictcomp>rr
rrrrrrrr)-rrr����$�%�&�'�-�.�/�0�1�6�7�8�9�:�;�?�@�A�B�C�D�E�H�I�J�K�L�M�N�O�Q�R�S�T�U�V�W�X�YcSs*i|]"}t|d|d�D]
}||�qqS)rr)r)rrrrrrr"s)rr)rrrr rrr�test_scope_isolationsz*DictComprehensionTest.test_scope_isolationc.Cs�ddddddddddd�
}dd�td�D�}|�||�|�td�ddddddd	d	d	d	d
d
d
d
d
dddddddddddddd
d
d
d
d
d
d
d
dddddddddd�-}dd�td�D�}|�td�|�||�dS)N)
rr
rrrrrrrrcSsi|]
}d|�qS)Nr)r�grrrr)szJDictComprehensionTest.test_scope_isolation_from_global.<locals>.<dictcomp>rzGlobal variabler
rrrrrrrr)-rrrr"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKcSs*i|]"}t|d|d�D]
}||�qqS)rr)r)rrrMrrrr3s)rrrM)rrr rrr� test_scope_isolation_from_global&sz6DictComprehensionTest.test_scope_isolation_from_globalcCs<ddddddddddd�
}dd�td�D�}|�||�dS)NzGlobal variable)
rr
rrrrrrrrcSsi|]
}t|�qSr)rM)rrrrrr=sz@DictComprehensionTest.test_global_visibility.<locals>.<dictcomp>r)rr)rrr rrr�test_global_visibility7s
z,DictComprehensionTest.test_global_visibilitycsPd�ddddddddddd�
}�fdd�td�D�}|�||�|��d�dS)NzLocal variable)
rr
rrrrrrrrcsi|]
}�|�qSrr)rr)rrrrGsz?DictComprehensionTest.test_local_visibility.<locals>.<dictcomp>r)rr)rrr r)rr�test_local_visibility@s
z+DictComprehensionTest.test_local_visibilityc	CsL|�td��tddd�WdQRX|�td��tddd�WdQRXdS)Nzcan't assignz'{x: y for y, x in ((1, 2), (3, 4))} = 5z<test>�execz({x: y for y, x in ((1, 2), (3, 4))} += 5)ZassertRaisesRegex�SyntaxError�compile)rrrr�test_illegal_assignmentKsz-DictComprehensionTest.test_illegal_assignmentN)	�__name__�
__module__�__qualname__r!rLrNrOrPrTrrrrrs
	r�__main__)ZunittestrMZTestCaserrU�mainrrrr�<module>sN