shell bypass 403
o
`b� � @ sZ d dl Z d dlmZ G dd� d�ZG dd� d�ZG dd� de j�Zed kr+e �� dS dS )
� N)� ALWAYS_EQc @ s e Zd Zdd� ZdS )�Emptyc C s dS )Nz<Empty>� ��selfr r �:/usr/local/python-3.10/lib/python3.10/test/test_compare.py�__repr__ s zEmpty.__repr__N)�__name__�
__module__�__qualname__r r r r r r s r c @ s$ e Zd Zdd� Zdd� Zdd� ZdS )�Cmpc C s
|| _ d S �N��arg)r r r r r �__init__ �
zCmp.__init__c C s
d| j S )Nz<Cmp %s>r r r r r r r zCmp.__repr__c C s
| j |kS r
r )r �otherr r r �__eq__ r z
Cmp.__eq__N)r r
r r r r r r r r r s r c @ sn e Zd Zdddded�gZdgdde� gZee Zdd� Zd d
� Z dd� Z
d
d� Zdd� Zdd� Z
dd� ZdS )�ComparisonTest� g @y @ � )� Nc C sR | j D ]#}| j D ]}|| jv r|| jv s||u r| �||� q| �||� qqd S r
)�
candidates�set1�assertEqualZassertNotEqual)r �a�br r r �test_comparisons s
��zComparisonTest.test_comparisonsc C sf g }t d�D ]
}|�t|�d t� � q|D ]}|D ]}| �||kt|�t|�kd||f � qqd S )N�
r z
a=%r, b=%r)�range�insert�lenr r �id)r �L�ir r r r r �test_id_comparisons s
���z"ComparisonTest.test_id_comparisonsc C sL t d�}t d�}t d�}| �||kd� | �||kd� | �||kd� d S )Nr r TF)r �assertIs)r r r �cr r r �test_ne_defaults_to_not_eq) s z)ComparisonTest.test_ne_defaults_to_not_eqc sH g � G � fdd�d�}G � fdd�d�}|� |� k | � � ddg� dS )z;object.__ne__() should allow reflected __ne__() to be triedc � e Zd Z� fdd�ZdS )z2ComparisonTest.test_ne_high_priority.<locals>.Leftc � � � d� tS )N�Left.__eq__��append�NotImplemented��args�Zcallsr r r 6 �
z9ComparisonTest.test_ne_high_priority.<locals>.Left.__eq__N�r r
r r r r1 r r �Left4 � r4 c �$ e Zd Z� fdd�Z� fdd�ZdS )z3ComparisonTest.test_ne_high_priority.<locals>.Rightc r* )NzRight.__eq__r, r/ r1 r r r : r2 z:ComparisonTest.test_ne_high_priority.<locals>.Right.__eq__c r* )N�Right.__ne__r, r/ r1 r r �__ne__= r2 z:ComparisonTest.test_ne_high_priority.<locals>.Right.__ne__N�r r
r r r8 r r1 r r �Right9 � r: r+ r7 N�ZassertSequenceEqual)r r4 r: r r1 r �test_ne_high_priority1 s
z$ComparisonTest.test_ne_high_priorityc sJ g � G � fdd�d�}G � fdd�d|�}|� |� k | � � ddg� dS )z4object.__ne__() should not invoke reflected __eq__()c r) )z1ComparisonTest.test_ne_low_priority.<locals>.Basec r* )N�Base.__eq__r, r/ r1 r r r H r2 z8ComparisonTest.test_ne_low_priority.<locals>.Base.__eq__Nr3 r r1 r r �BaseF r5 r? c r6 )z4ComparisonTest.test_ne_low_priority.<locals>.Derivedc r* )NzDerived.__eq__r, r/ r1 r r r L r2 z;ComparisonTest.test_ne_low_priority.<locals>.Derived.__eq__c r* )N�Derived.__ne__r, r/ r1 r r r8 O r2 z;ComparisonTest.test_ne_low_priority.<locals>.Derived.__ne__Nr9 r r1 r r �DerivedK r; rA r@ r>