HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/sqlalchemy/testing/__pycache__/entities.cpython-310.pyc
o

���g
�@sjddlmZddlZddlmZddlmZe	�Z
Gdd�d�Ze	�ZGdd	�d	�Z
Gd
d�de
e�ZdS)�)�annotationsN�)�exc)�WriteOnlyCollectionc@�eZdZdd�Zdd�ZdS)�BasicEntitycKs"|��D]
\}}t|||�qdS�N)�items�setattr)�self�kw�key�value�r�F/usr/local/lib/python3.10/dist-packages/sqlalchemy/testing/entities.py�__init__s�zBasicEntity.__init__c
stt��tvrt���St�t���zd�jjd��fdd�t�j	�
��D��fWt�t���St�t���w)Nz%s(%s)z, cs(g|]}|�d�sd|t�|�f�qS)�_z%s=%r)�
startswith�getattr)�.0r
�rrr�
<listcomp> s��z(BasicEntity.__repr__.<locals>.<listcomp>)�id�_repr_stack�object�__repr__�add�	__class__�__name__�join�sorted�__dict__�keys�removerrrrrs

��� zBasicEntity.__repr__N)r�
__module__�__qualname__rrrrrrrsrc@r)�ComparableMixincCs|�|�Sr)�__eq__)r�otherrrr�__ne__/szComparableMixin.__ne__c
Cs�||urdS|j|jksdSt|�tvrdSt�t|��z�z
tjj�|�j}Wntjj	j
y6d}Ynw|dur@|}|}n
|durI|}|}n|}|}t|j�D]�}|�
d�rZqRt||�}t|t�reqRzt||�}Wnttjfy�YWt�t|��dSwt|d�r�t|t�s�t|d�r�t|d�s�t|�t|�kr�Wt�t|��dSqRt|�t|�kr�Wt�t|��dSqR|dur�||kr�Wt�t|��dSqRWt�t|��dSt�t|��w)z�'Deep, sparse compare.

        Deeply compare two entities, following the non-None attributes of the
        non-persisted object, if possible.

        TFNr�__iter__�__getitem__r")rr�_recursion_stackr�sa�orm�
attributes�instance_stater
r�NO_STATE�listr!rr�
isinstancer�AttributeError�sa_exc�UnboundExecutionErrorr#�hasattr�str�set)rr(�self_key�a�b�attrr�battrrrrr'2sf�


��	����"zComparableMixin.__eq__N)rr$r%r)r'rrrrr&.sr&c@seZdZdd�ZdS)�ComparableEntitycCs
t|j�Sr)�hashrrrrr�__hash__ts
zComparableEntity.__hash__N)rr$r%rArrrrr?ssr?)�
__future__r�
sqlalchemyr-�rr5�
orm.writeonlyrr9rrr,r&r?rrrr�<module>s	E