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.7/test/__pycache__/test_compare.cpython-37.pyc
B

��gJ�@sXddlZGdd�d�ZGdd�d�ZGdd�d�ZGdd	�d	ej�Zed
krTe��dS)�Nc@seZdZdd�ZdS)�EmptycCsdS)Nz<Empty>�)�selfrr�-/usr/local/lib/python3.7/test/test_compare.py�__repr__szEmpty.__repr__N)�__name__�
__module__�__qualname__rrrrrrsrc@s$eZdZdd�Zdd�Zdd�ZdS)�CmpcCs
||_dS)N)�arg)rrrrr�__init__szCmp.__init__cCs
d|jS)Nz<Cmp %s>)r)rrrrrszCmp.__repr__cCs
|j|kS)N)r)r�otherrrr�__eq__sz
Cmp.__eq__N)rrr	rrrrrrrr
sr
c@seZdZdd�Zdd�ZdS)�AnythingcCsdS)NTr)rr
rrrrszAnything.__eq__cCsdS)NFr)rr
rrr�__ne__szAnything.__ne__N)rrr	rrrrrrrsrc@sneZdZdddded�gZdgdde�gZeeZdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�ZdS)�ComparisonTest�g@y@�)�NcCsZxT|jD]J}xD|jD]:}||jkr,||jks4||krB|�||�q|�||�qWqWdS)N)�
candidates�set1�assertEqualZassertNotEqual)r�a�brrr�test_comparisonss
zComparisonTest.test_comparisonsc	Csrg}x&td�D]}|�t|�dt��qWx@|D]8}x2|D]*}|�||kt|�t|�kd||f�q<Wq2WdS)N�
rz
a=%r, b=%r)�range�insert�lenrr�id)r�L�irrrrr�test_id_comparisons%s

z"ComparisonTest.test_id_comparisonscCsLtd�}td�}td�}|�||kd�|�||kd�|�||kd�dS)NrrTF)r
�assertIs)rrr�crrr�test_ne_defaults_to_not_eq/sz)ComparisonTest.test_ne_defaults_to_not_eqcsHg�G�fdd�d�}G�fdd�d�}|�|�k|��ddg�dS)z;object.__ne__() should allow reflected __ne__() to be triedcseZdZ�fdd�ZdS)z2ComparisonTest.test_ne_high_priority.<locals>.Leftcs��d�tS)NzLeft.__eq__)�append�NotImplemented)�args)�callsrrr<s
z9ComparisonTest.test_ne_high_priority.<locals>.Left.__eq__N)rrr	rr)r)rr�Left:sr*cs$eZdZ�fdd�Z�fdd�ZdS)z3ComparisonTest.test_ne_high_priority.<locals>.Rightcs��d�tS)NzRight.__eq__)r&r')r()r)rrr@s
z:ComparisonTest.test_ne_high_priority.<locals>.Right.__eq__cs��d�tS)NzRight.__ne__)r&r')r()r)rrrCs
z:ComparisonTest.test_ne_high_priority.<locals>.Right.__ne__N)rrr	rrr)r)rr�Right?sr+zLeft.__eq__zRight.__ne__N)�assertSequenceEqual)rr*r+r)r)r�test_ne_high_priority7s
z$ComparisonTest.test_ne_high_prioritycsJg�G�fdd�d�}G�fdd�d|�}|�|�k|��ddg�dS)z4object.__ne__() should not invoke reflected __eq__()cseZdZ�fdd�ZdS)z1ComparisonTest.test_ne_low_priority.<locals>.Basecs��d�tS)NzBase.__eq__)r&r')r()r)rrrNs
z8ComparisonTest.test_ne_low_priority.<locals>.Base.__eq__N)rrr	rr)r)rr�BaseLsr.cs$eZdZ�fdd�Z�fdd�ZdS)z4ComparisonTest.test_ne_low_priority.<locals>.Derivedcs��d�tS)NzDerived.__eq__)r&r')r()r)rrrRs
z;ComparisonTest.test_ne_low_priority.<locals>.Derived.__eq__cs��d�tS)NzDerived.__ne__)r&r')r()r)rrrUs
z;ComparisonTest.test_ne_low_priority.<locals>.Derived.__ne__N)rrr	rrr)r)rr�DerivedQsr/zDerived.__ne__zBase.__eq__N)r,)rr.r/r)r)r�test_ne_low_priorityIs
z#ComparisonTest.test_ne_low_priorityc
s�ddd�fddd�fddd�fdd	d�fd
dd�ff}x�|D]�\}}��|��~�fdd
��G�fdd�d�}x$|D]\}}||krtt||��qtW|dkr���||�t��d�n��t||�t��WdQRXq<WdS)z8No default delegation between operations except __ne__()rcSs||kS)Nr)rrrrr�<lambda>^�z6ComparisonTest.test_other_delegation.<locals>.<lambda>�__lt__cSs||kS)Nr)rrrrrr1_r2�__le__cSs||kS)Nr)rrrrrr1`r2�__gt__cSs||kS)Nr)rrrrrr1ar2�__ge__cSs||kS)Nr)rrrrrr1br2cs��d�dS)Nz!Unexpected operator method called)Zfail)r()rrr�
unexpectedfsz8ComparisonTest.test_other_delegation.<locals>.unexpectedcseZdZ�ZdS)z/ComparisonTest.test_other_delegation.<locals>.CN)rrr	rr)r7rr�Chsr8FN)ZsubTest�setattrr#�objectZassertRaises�	TypeError)rZops�name�funcr8r
�_r)rr7r�test_other_delegation[s



z$ComparisonTest.test_other_delegationcCsJdd�}|�|t��|�t�|�t�}|�|t��|�t�|�dS)NcSsdS)Nrrrrrr1sr2z0ComparisonTest.test_issue_1393.<locals>.<lambda>)rrr:)r�x�yrrr�test_issue_1393rszComparisonTest.test_issue_1393)rrr	r
rrZset2rrr"r%r-r0r?rBrrrrrs
r�__main__)Zunittestrr
rZTestCaserr�mainrrrr�<module>s
c