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_iterlen.cpython-310.opt-2.pyc
o

�ib�@s�	ddlZddlmZddlmZddlmZdZGdd�d�ZGdd	�d	e�Z	Gd
d�deej
�ZGdd
�d
eej
�ZGdd�deej
�Z
Gdd�deej
�ZGdd�de	ej
�ZGdd�de	ej
�ZGdd�de	ej
�ZGdd�de	ej
�ZGdd�de	ej
�ZGdd�de	ej
�ZGdd�deej
�ZGd d!�d!eej
�ZGd"d#�d#e�ZGd$d%�d%e�ZGd&d'�d'e�ZGd(d)�d)ej
�Zed*kr�e��dSdS)+�N)�repeat)�deque)�length_hint�
c@�eZdZdd�ZdS)�TestInvariantWithoutMutationscCsh|j}ttdtd��D]}|�t|�|�t|�q|�t|�d�|�tt|�|�t|�d�dS�N�r)	�it�reversed�range�n�assertEqualr�next�assertRaises�
StopIteration)�selfr
�i�r�./usr/local/lib/python3.10/test/test_iterlen.py�test_invariant6s
z,TestInvariantWithoutMutations.test_invariantN)�__name__�
__module__�__qualname__rrrrrr4�rc@r)�TestTemporarilyImmutablecCs\|j}|�t|�t�t|�|�t|�td�|��|�tt|�|�t|�d�dSr)r
rrr
r�mutater�RuntimeError)rr
rrr�test_immutable_during_iterationAsz8TestTemporarilyImmutable.test_immutable_during_iterationN)rrrrrrrrr?rrc@r)�
TestRepeatcCstdt�|_dS�N)rr
r
�rrrr�setUpQszTestRepeat.setUpN�rrrr"rrrrrOrrc@r)�
TestXrangecC�ttt��|_dSr ��iterrr
r
r!rrrr"V�zTestXrange.setUpNr#rrrrr$Trr$c@r)�TestXrangeCustomReversedcCr%r �rrr
r
r!rrrr"[r(zTestXrangeCustomReversed.setUpNr#rrrrr)Yrr)c@r)�	TestTuplecCstttt���|_dSr )r'�tuplerr
r
r!rrrr"`szTestTuple.setUpNr#rrrrr+^rr+c@r)�	TestDequecC�"ttt��}t|�|_|j|_dSr )rrr
r'r
�popr�r�drrrr"g�
zTestDeque.setUpNr#rrrrr-err-c@r)�TestDequeReversedcCr.r )rrr
rr
r/rr0rrrr"nr2zTestDequeReversed.setUpNr#rrrrr3lrr3c@r)�TestDictKeyscCs$t�tt��}t|�|_|j|_dSr )�dict�fromkeysrr
r'r
�popitemrr0rrrr"us
zTestDictKeys.setUpNr#rrrrr4srr4c@r)�
TestDictItemscC�(t�tt��}t|���|_|j|_dSr )	r5r6rr
r'�itemsr
r7rr0rrrr"|�zTestDictItems.setUpNr#rrrrr8zrr8c@r)�TestDictValuescCr9r )	r5r6rr
r'�valuesr
r7rr0rrrr"�r;zTestDictValues.setUpNr#rrrrr<�rr<c@r)�TestSetcCr.r )�setrr
r'r
r/rr0rrrr"�r2z
TestSet.setUpNr#rrrrr>�rr>c@�eZdZdd�Zdd�ZdS)�TestListcCr%r r&r!rrrr"�r(zTestList.setUpcCs�ttt��}t|�}t|�t|�|�t|�td�|�t�|�t|�td�g|dd�<|�t|�d�|�t|�g�|�td��|�t|�d�dS�N�r	r�)	�listrr
r'rrr�append�extend�rr1r
rrr�
test_mutation��
zTestList.test_mutationN�rrrr"rIrrrrrA��rAc@r@)�TestListReversedcCr%r r*r!rrrr"�r(zTestListReversed.setUpcCs�ttt��}t|�}t|�t|�|�t|�td�|�t�|�t|�td�g|dd�<|�t|�d�|�t|�g�|�td��|�t|�d�dSrB)	rErr
rrrrrFrGrHrrrrI�rJzTestListReversed.test_mutationNrKrrrrrM�rLrMc@r@)�BadLencC�ttd��S�Nr�r'rr!rrr�__iter__��zBadLen.__iter__cC�td���NZhello�rr!rrr�__len__��zBadLen.__len__N)rrrrRrWrrrrrN��rNc@r@)�
BadLengthHintcCrOrPrQr!rrrrR�rSzBadLengthHint.__iter__cCrTrUrVr!rrr�__length_hint__�rXzBadLengthHint.__length_hint__N�rrrrRr[rrrrrZ�rYrZc@r@)�NoneLengthHintcCrOrPrQr!rrrrR�rSzNoneLengthHint.__iter__cCstSr )�NotImplementedr!rrrr[�szNoneLengthHint.__length_hint__Nr\rrrrr]�rYr]c@r@)�TestLengthHintExceptionscCsx|�ttt��|�ttt��|�tgjt��|�tgjt��ttd��}|�t|jt��|�t|jt��dSrP)rrrErNrZrG�	bytearrayr)r�brrr�test_issue1242657�sz*TestLengthHintExceptions.test_issue1242657cCs|�tt��ttd���dSrP)rrEr]rr!rrr�test_invalid_hint�sz*TestLengthHintExceptions.test_invalid_hintN)rrrrbrcrrrrr_�s	r_�__main__)Zunittest�	itertoolsr�collectionsr�operatorrr
rrZTestCaserr$r)r+r-r3r4r8r<r>rArM�objectrNrZr]r_r�mainrrrr�<module>s6+	�