HEX
Server: Apache
System: Linux opal14.opalstack.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User: curbgloabal_opal (1234)
PHP: 8.1.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib64/python3.6/test/__pycache__/test_dictcomps.cpython-36.pyc
3


 \��@s2ddlZdZGdd�dej�Zedkr.ej�dS)�NzGlobal variablec@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�DictComprehensionTestcCstddddddddd	d
d�
}dd
�td�D�}|j||�ddddddddddd�
}dd
�td�D�}|j||�dS)N�
���
������)
r���������	cSsi|]}|d|�qS)r�)�.0�krr�&/usr/lib64/python3.6/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�}|j||�|j|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�}|j|d�|j||�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�}|j||�|jtd�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�}|jtd�|j||�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�}|j||�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�}|j||�|j�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_visibilitycCsL|jtd��tddd�WdQRX|jtd��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