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

�ih
�@sxddlmZddlZddlmZGdd�d�ZGdd�de�ZGdd	�d	e�ZGd
d�dej�Z	e
dkr:e��dSdS)
�)�dequeN)�NEVER_EQc@�eZdZdd�ZdS)�base_setcCs
||_dS�N��el��selfr�r�//usr/local/lib/python3.10/test/test_contains.py�__init__�
zbase_set.__init__N)�__name__�
__module__�__qualname__r
rrrrr�rc@r)�mysetcCs
|j|kSrrr	rrr�__contains__rzmyset.__contains__N�rrrrrrrrr
rrc@r)�seqcCs|jg|Srr)r
�nrrr�__getitem__szseq.__getitem__N)rrrrrrrrrrrc@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�rc�d�vS�Nrrr��arr�<lambda>�z0TestContains.test_common_tests.<locals>.<lambda>csd�vSrrrrrrrr �c�abc�d�cSsddvS)Nr"rrrrrr%r )rrr�assertIn�assertNotIn�assertRaises�	TypeError)r
�br!rrr�test_common_testsszTestContains.test_common_testscCs�td�}|D]}|�||�q|�d|�|�||�t|�}|D]}|�||�q!|�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)rrr�__doc__�list�ranger1r5rrrr�Deviant15sr9)r8r%r&�tupler1)r
r�ir9rrr�test_builtin_sequence_types'sz(TestContains.test_builtin_sequence_typescCsptd�dddtf}tttjtttf}|D]!}||�}|D]}|�	||�q|�
|||�k�|�
||k�qdS)N�nanrr")�floatrr7r:�dict�fromkeys�set�	frozensetrr%Z
assertTrue)r
�valuesZconstructors�constructor�	container�elemrrr�test_nonreflexiveEs�zTestContains.test_nonreflexivecsdGdd�dt�}|�}Gdd�d|�}|��|�d|v�|�dt��v�|�t�fdd��dS)Nc@r)z4TestContains.test_block_fallback.<locals>.ByContainscSsdS)NFrr3rrrrUszATestContains.test_block_fallback.<locals>.ByContains.__contains__Nrrrrr�
ByContainsTrrHc@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.
            css�dSrr)r
rrr�__iter__cs�z@TestContains.test_block_fallback.<locals>.BlockContains.__iter__N)rrrr6rIrrrrr�
BlockContainsXs
rJrcr)Nrrr�Zbcrrrjr z2TestContains.test_block_fallback.<locals>.<lambda>)�objectZassertFalser7r'r()r
rHr!rJrrKr�test_block_fallbackRsz TestContains.test_block_fallbackN)rrrr*r<rGrMrrrrrs

r�__main__)�collectionsrZunittestZtest.supportrrrrZTestCaserr�mainrrrr�<module>sZ�