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: //proc/thread-self/root/usr/local/lib/python3.7/test/__pycache__/test_contains.cpython-37.pyc
B

��g�
�@shddlmZddlZGdd�d�ZGdd�de�ZGdd�de�ZGd	d
�d
ej�Zedkrde�	�dS)�)�dequeNc@seZdZdd�ZdS)�base_setcCs
||_dS)N)�el)�selfr�r�./usr/local/lib/python3.7/test/test_contains.py�__init__szbase_set.__init__N)�__name__�
__module__�__qualname__rrrrrrsrc@seZdZdd�ZdS)�mysetcCs
|j|kS)N)r)rrrrr�__contains__
szmyset.__contains__N)r	r
rr
rrrrr	src@seZdZdd�ZdS)�seqcCs|jg|S)N)r)r�nrrr�__getitem__szseq.__getitem__N)r	r
rrrrrrr
src@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�TestContainscs�td��td�}td�}|�d|�|�d|�|�d|�|�d|�|�t�fdd��|�t�fdd��|�dd�|�dd�|�d	d	�|�d	d�|�td
d��dS)N�rcsd�kS)Nrrr)�arr�<lambda>�z0TestContains.test_common_tests.<locals>.<lambda>csd�kS)Nrrr)rrrrr�c�abc�d�cSsddkS)Nrrrrrrr$r)rrr�assertIn�assertNotIn�assertRaises�	TypeError)r�brr)rr�test_common_testsszTestContains.test_common_testscCs�td�}x|D]}|�||�qW|�d|�|�||�t|�}x|D]}|�||�qHW|�d|�|�||�Gdd�d�}|�|�|j�dS)N�
�c@s$eZdZdZeed��Zdd�ZdS)z:TestContains.test_builtin_sequence_types.<locals>.Deviant1z�Behaves strangely when compared

            This class is designed to make sure that the contains code
            works when the list is modified during the check.
            �cSs0|dkr,|j�d�|j�d�|j�d�dS)N��
�r)�aList�remove)r�otherrrr�__eq__;s
zATestContains.test_builtin_sequence_types.<locals>.Deviant1.__eq__N)r	r
r�__doc__�list�ranger&r)rrrr�Deviant14sr-)r,rr�tupler&)rr�ir-rrr�test_builtin_sequence_types&s

z(TestContains.test_builtin_sequence_typescCs�Gdd�dt�}td�ddd|�f}tttjtttf}xN|D]F}||�}x|D]}|�	||�qNW|�
|||�k�|�
||k�q<WdS)Nc@seZdZdd�Zdd�ZdS)z6TestContains.test_nonreflexive.<locals>.MyNonReflexivecSsdS)NFr)rr(rrrr)Isz=TestContains.test_nonreflexive.<locals>.MyNonReflexive.__eq__cSsdS)N�r)rrrr�__hash__Ksz?TestContains.test_nonreflexive.<locals>.MyNonReflexive.__hash__N)r	r
rr)r2rrrr�MyNonReflexiveHsr3�nanrr)�object�floatr+r.�dict�fromkeys�set�	frozensetrrZ
assertTrue)rr3�valuesZconstructors�constructor�	container�elemrrr�test_nonreflexiveDs

zTestContains.test_nonreflexivecsdGdd�dt�}|�}Gdd�d|�}|��|�d|k�|�dt��k�|�t�fdd��dS)Nc@seZdZdd�ZdS)z4TestContains.test_block_fallback.<locals>.ByContainscSsdS)NFr)rr(rrrr
ZszATestContains.test_block_fallback.<locals>.ByContains.__contains__N)r	r
rr
rrrr�
ByContainsYsr@c@seZdZdZdd�ZdZdS)z7TestContains.test_block_fallback.<locals>.BlockContainsa�Is not a container

            This class is a perfectly good iterable (as tested by
            list(bc)), as well as inheriting from a perfectly good
            container, but __contains__ = None prevents the usual
            fallback to iteration in the container protocol. That
            is, normally, 0 in bc would fall back to the equivalent
            of any(x==0 for x in bc), but here it's blocked from
            doing so.
            cssdS)Nr)rrrr�__iter__hsz@TestContains.test_block_fallback.<locals>.BlockContains.__iter__N)r	r
rr*rAr
rrrr�
BlockContains]s
rBrcsd�kS)Nrrr)�bcrrrorz2TestContains.test_block_fallback.<locals>.<lambda>)r5ZassertFalser+rr)rr@rrBr)rCr�test_block_fallbackWsz TestContains.test_block_fallbackN)r	r
rrr0r?rDrrrrrsr�__main__)
�collectionsrZunittestrrrZTestCaserr	�mainrrrr�<module>s`