Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/test/__pycache__/seq_tests.cpython-38.opt-2.pyc
U

>��g�8�@s�ddlZddlZddlZddlmZdd�ZGdd�d�ZGdd�d�ZGd	d
�d
�ZGdd�d�Z	Gd
d�d�Z
Gdd�d�ZGdd�d�Zddl
mZdd�ZGdd�de�ZGdd�de�ZGdd�dej�ZdS)�N)�supportccs|D]
}|VqdS�N���seqn�irr�-/opt/cppython/lib/python3.8/test/seq_tests.py�iterfuncsr	c@seZdZdd�Zdd�ZdS)�SequencecCs
||_dSr�r��selfrrrr�__init__szSequence.__init__cCs
|j|Srr�r
rrrr�__getitem__szSequence.__getitem__N)�__name__�
__module__�__qualname__rrrrrrr
sr
c@s$eZdZdd�Zdd�Zdd�ZdS)�IterFunccCs||_d|_dS�NrrrrrrrszIterFunc.__init__cCs|Srr�r
rrr�__iter__szIterFunc.__iter__cCs2|jt|j�krt�|j|j}|jd7_|S�N��r�lenr�
StopIteration�r
�vrrr�__next__s
zIterFunc.__next__N�rrrrrrrrrrrsrc@seZdZdd�Zdd�ZdS)�IterGencCs||_d|_dSrrrrrrr'szIterGen.__init__ccs|jD]
}|VqdSrr)r
�valrrrr*s
zIterGen.__iter__N�rrrrrrrrrr!%sr!c@seZdZdd�Zdd�ZdS)�IterNextOnlycCs||_d|_dSrrrrrrr0szIterNextOnly.__init__cCs2|jt|j�krt�|j|j}|jd7_|Srrrrrrr3s
zIterNextOnly.__next__N)rrrrrrrrrr$.sr$c@seZdZdd�Zdd�ZdS)�
IterNoNextcCs||_d|_dSrrrrrrr;szIterNoNext.__init__cCs|Srrrrrrr>szIterNoNext.__iter__Nr#rrrrr%9sr%c@s$eZdZdd�Zdd�Zdd�ZdS)�
IterGenExccCs||_d|_dSrrrrrrrCszIterGenExc.__init__cCs|SrrrrrrrFszIterGenExc.__iter__cCsdddS)N�rrrrrrrHszIterGenExc.__next__Nr rrrrr&Asr&c@s$eZdZdd�Zdd�Zdd�ZdS)�IterFuncStopcCsdSrrrrrrrMszIterFuncStop.__init__cCs|SrrrrrrrOszIterFuncStop.__iter__cCst�dSr)rrrrrrQszIterFuncStop.__next__Nr rrrrr(Ksr()�chaincCsttdd�ttt|�����S)NcSs|Srr)�xrrr�<lambda>W�zitermulti.<locals>.<lambda>)r)�mapr	r!r
rrrr�	itermultiUsr.c@seZdZdd�ZdS)�
LyingTupleccs
dVdSrrrrrrrZszLyingTuple.__iter__N�rrrrrrrrr/Ysr/c@seZdZdd�ZdS)�	LyingListccs
dVdSrrrrrrr^szLyingList.__iter__Nr0rrrrr1]sr1c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�ZdS)*�
CommonTestNcCs�g}dg}ddg}|��}|�|�}|�|�}|�|�}|�|�}|�|�}	|�|�}
|�|�}|�t|��}Gdd�d�}
|
|�}|�|�}|�t|�t|��d}|�|�}|�t|�t|��ddtd�d	td
dd�fD]�}ttttt	fD] }|�|�||��|�|��q�|�|�t
|��|���|�|�d
d�dD��|�d��|�t|jt
|��|�t|jt|��|�t|jt|��q�|�|�td��|�d��|�|�tdg��|�dg��dS)Nrrc@s$eZdZdd�Zdd�Zdd�ZdS)z.CommonTest.test_constructors.<locals>.OtherSeqcSs
||_dSr��_OtherSeq__data)r
Zinitseqrrrrvsz7CommonTest.test_constructors.<locals>.OtherSeq.__init__cSs
t|j�Sr)rr4rrrr�__len__xsz6CommonTest.test_constructors.<locals>.OtherSeq.__len__cSs
|j|Srr3rrrrrzsz:CommonTest.test_constructors.<locals>.OtherSeq.__getitem__N)rrrrr5rrrrr�OtherSequsr6zthis is also a sequenceZ123���)Zdog333333�?i�i��css|]
}|VqdSrr)�.0�crrr�	<genexpr>�sz/CommonTest.test_constructors.<locals>.<genexpr>)�)rr=)�	type2test�tuple�assertEqualr�ranger
rr!r.r	r(�assertRaises�	TypeErrorr$r%�ZeroDivisionErrorr&r/r1)r
Zl0�l1�l2�uZu0�u1�u2�uuZuu0Zuu1Zuu2rr6�sZv0Zvv�grrr�test_constructorses@








�"zCommonTest.test_constructorscCs$|�|���|�|�dg��dS)N�*)ZassertFalser>Z
assertTruerrrr�
test_truth�szCommonTest.test_truthcCs�|�dddddg�}tt|��D](}|�|||�|�|t|�|�q tt|�d�D]8}|�||t|�|�|�|t|�t|�|�qZ|�t|jt|�d�|�t|jt|��|�t|jt	ddd��|��}|�t|jd�|�t|jd�|�t
|j�|�ddg�}|�|dd�|�|dd�|�|d	d�|�|dd�|�t|jd
�|�t|jd�dS)Nrrr=r'�����
�������)r>rArr@�intrB�
IndexErrorr�
ValueError�slicerC)r
rGr�arrr�test_getitem�s*zCommonTest.test_getitemc
CsPdddddg}|�|�}|�|dd�|���|�|dd�|�dg��|�|dd�|�dg��|�|dd	�|�|�|d	d�|�g��|�|dd�|�|�|dd�|�ddddg��|�|dd�|�dddg��|�|dd�|�|�|ddd�|�dddg��|�|ddd�|�ddg��|�|ddd�|�dddddg��|�|ddd�|�dddg��|�|ddd�|�ddg��|�|ddd�|�g��|�|ddd�|�dg��|�|ddd�|�dg��|�|ddd�|�ddg��|�|ddd
�|�dg��|�|dd
�|�g��|�|d
d�|�|�|dd
d�|ddd��|�|d
dd�|�g��|�|d
dd�|�dddg��|�dddddg�}|�|tdd�d�|�dddg��|�|dtdd
��|�ddg��|�|ddtj�|�dg��dS)Nrrr=r'rPrTrQi���r8i�����d��)r>r@�pow�sys�maxsize)r
�lrGrZrrr�
test_getslice�s<
" " &"   "($zCommonTest.test_getslicecCsb|�dddg�}|D]}|�||�qt|�dt|�dfD]}|�||�q>|�t|j�dS�Nrrr=)r>�assertIn�min�max�assertNotInrBrC�__contains__)r
rGrrrr�
test_contains�szCommonTest.test_containscCs<Gdd�d�}|�|�|�g��|�|�|�dg��dS)Nc@seZdZdd�ZdZdS)z,CommonTest.test_contains_fake.<locals>.AllEqcSsdS)NTr�r
�otherrrr�__eq__�sz3CommonTest.test_contains_fake.<locals>.AllEq.__eq__N)rrrrm�__hash__rrrr�AllEq�sror)rhr>re)r
rorrr�test_contains_fake�szCommonTest.test_contains_fakecsbGdd�dt��G�fdd�d�}|�d|�g�}|�d|�|�|�dg�}|��|jd�dS)Nc@seZdZdS)z3CommonTest.test_contains_order.<locals>.DoNotTestEqN�rrrrrrr�DoNotTestEq�srrcseZdZ�fdd�ZdS)z4CommonTest.test_contains_order.<locals>.StopComparescs��dSrrrk�rrrrrm�sz;CommonTest.test_contains_order.<locals>.StopCompares.__eq__N�rrrrmrrsrr�StopCompares�srur)�	Exceptionr>rerBri)r
ruZ
checkfirstZ	checklastrrsr�test_contains_order�szCommonTest.test_contains_ordercCsb|�t|���d�|�t|�g��d�|�t|�dg��d�|�t|�dddg��d�dS)Nrrr=r')r@rr>rrrr�test_len�szCommonTest.test_lencCs4|�dddg�}|�t|�d�|�t|�d�dSrd)r>r@rfrg�r
rGrrr�test_minmax�szCommonTest.test_minmaxcCs�|�dg�}|�ddg�}|�|||���|�||��|�|�||�dg�|�|�|�dg�||�ddg��|�|��|d�|�|��d|�|�|��|d�|�|��d|�|�||d�|�|d|�|�||d�|�|d|�|�|||d�|�||d|�|�|||d�|�||d|�|�||||d�|�|||d|�Gdd�d|j�}|ddg�}|�||d�|�||d�dS)NrrrQr=r'c@seZdZdS)z(CommonTest.test_addmul.<locals>.subclassNrqrrrr�subclasssr{)r>r@ZassertIsNot)r
rHrIr{�u3rrr�test_addmuls0"zCommonTest.test_addmulcCs�|�ddg�}||��7}|�||�ddg��||�ddg�7}|�||�ddddg��||�ddg�7}|�||�ddddddg��|�d�}||�d�7}|�||�d	��dS)
Nrrr=r'rPr9ZspamZeggsZspameggs�r>r@ryrrr�	test_iadd s
zCommonTest.test_iaddcCsR|�ddg�}|d9}|�||�ddddddg��|d9}|�||�g��dS)Nrrr'r~ryrrr�	test_imul-s
zCommonTest.test_imulcCs.Gdd�d|j�}|�tt|d���d�dS)Nc@seZdZdd�ZdS)z/CommonTest.test_getitemoverwriteiter.<locals>.TcSst|�dS)Nz!!!)�str)r
�keyrrrr7sz;CommonTest.test_getitemoverwriteiter.<locals>.T.__getitem__N)rrrrrrrr�T6sr�)rr=r)r>r@�next�iter)r
r�rrr�test_getitemoverwriteiter4sz$CommonTest.test_getitemoverwriteitercCs�td�D]t}tt|��}tdd�D]$}|�|�||�|�|�|�q"|�|�|�d|�g��|�t|�t|d��qdS)NrPrUr9���r)rAr?r@r>�id)r
�mrK�nrrr�test_repeat;s"zCommonTest.test_repeatcCsLtjdkrH|�dg�}|d9}|�t|jd�t|d�rH|�t|jd�dS)Ni���ri�__imul__)r`rar>rB�MemoryError�__mul__�hasattrr�)r
r*rrr�test_bigrepeatCs

zCommonTest.test_bigrepeatcCsD|�ddg�}|�|�d�d�|�|�d�d�|�|�d�d�|�|�d�d�|�t|jd�|�t|jd�|�|�tdd��|�dg��|�|�tdd	��|�dg��|�|�tdd	��|�ddg��|�|�tdd��|�ddg��|�|�tdd
��|�g��|�t|jtddd��|�t|jd�dS)NrRrSrrrTrQrUr'r=r9r*)r>r@rrBrWrYrXrC)r
rZrrr�test_subscriptKs  ""zCommonTest.test_subscriptcs�|�dddg�d}|�|�d�d�|�|�d�d�|�|�d�d�|�t|j�Gdd�dt��G�fdd�d�}|��|j|��dS)	Nrrr=r'c@seZdZdS)z%CommonTest.test_count.<locals>.BadExcNrqrrrr�BadExccsr�cseZdZ�fdd�ZdS)z%CommonTest.test_count.<locals>.BadCmpcs|dkr���dS�Nr=Frrk�r�rrrmgsz,CommonTest.test_count.<locals>.BadCmp.__eq__Nrtrr�rr�BadCmpfsr�)r>r@�countrBrCrv)r
rZr�rr�r�
test_count[szCommonTest.test_countcsH|�ddg�}|�|�d�d�|�|�d�d�|�t|jd�|�ddddddg�}|�|�d�d�|�|�d�d�|�|�dd�d�|�|�dd�d�|�|�dd�d�|�|�ddd�d�|�t|jddd�|�t|j�Gd	d
�d
t��G�fdd�d�}|�ddddg�}|��|j|��|�ddddddg�}|�|�d�d�|�|�dd�d�|�|�dd
�d�|�|�dd�d�|�|�dd�d�|�|�dd�d�|�|�ddd�d�|�|�ddd�d�|�|�dd
tj	dtj	�d�|�t|jddtj	d
tj	�|�t|jddd�dS)Nrrr=rTrQi����r'rPc@seZdZdS)z%CommonTest.test_index.<locals>.BadExcNrqrrrrr�sr�cseZdZ�fdd�ZdS)z%CommonTest.test_index.<locals>.BadCmpcs|dkr���dSr�rrkr�rrrm�sz,CommonTest.test_index.<locals>.BadCmp.__eq__Nrtrr�rrr��sr�r�rU)
r>r@�indexrBrXr�rCrvr`ra)r
rGr�rZrr�r�
test_indexns:" zCommonTest.test_indexcCs\|�ddddg�}ttjd�D]6}t�t�||��}|�||�|�t|�t|��q dS)NrPr9��r)	r>rA�pickle�HIGHEST_PROTOCOL�loads�dumpsr@ZassertNotEqualr�)r
Zlst�protoZlst2rrr�test_pickle�s
zCommonTest.test_picklecCs$t�|t|j�t�|t|j�dSr)rZcheck_free_after_iteratingr�r>�reversedrrrr�test_free_after_iterating�sz$CommonTest.test_free_after_iterating)rrrr>rMrOr[rcrjrprwrxrzr}rr�r�r�r�r�r�r�r�r�rrrrr2as*.%	
*r2)Zunittestr`r��testrr	r
rr!r$r%r&r(�	itertoolsr)r.r?r/�listr1ZTestCaser2rrrr�<module>s 
	
	

F1le Man4ger