
    h                        d dl mZ d dlZddlmZ ddlmZ  e	       Z
 G d d      Z e	       Z G d d	      Z G d
 dee      Zy)    )annotationsN   )exc)WriteOnlyCollectionc                      e Zd Zd Zd Zy)BasicEntityc                N    |j                         D ]  \  }}t        | ||        y N)itemssetattr)selfkwkeyvalues       DD:\EasyAligner\venv\Lib\site-packages\sqlalchemy/testing/entities.py__init__zBasicEntity.__init__   s"    ((*JCD#u% %    c                   t        |       t        v rt        j                  |       S t        j	                  t        |              	 | j
                  j                  ddj                  t        | j                  j                               D cg c]$  }|j                  d      s|dt        | |      & c}      dt        j                  t        |              S c c}w # t        j                  t        |              w xY w)N(z, _=))id_repr_stackobject__repr__add	__class____name__joinsorted__dict__keys
startswithgetattrremove)r   r   s     r   r   zBasicEntity.__repr__   s    d8{"??4((4!	)((		 $*$--*<*<*>#?#?C"~~c2 $'c(:;#?	 r$x( r$x(s   AC# )C6	C# C# # DN)r   
__module____qualname__r   r    r   r   r   r      s    &)r   r   c                      e Zd Zd Zd Zy)ComparableMixinc                &    | j                  |       S r
   )__eq__)r   others     r   __ne__zComparableMixin.__ne__/   s    ;;u%%%r   c                   || u ry| j                   |j                   k(  syt        |       t        v ryt        j                  t        |              	 	 t        j
                  j                  j                  |       j                  }|| }|}n||}| }n| }|}t        |j                        D ]
  }|j                  d      rt        ||      }t        |t               r3	 t        ||      }t+        |d      rt        |t,              st+        |d      rDt+        |d      s8t        |      t        |      k7  s t        j)                  t        |              yt/        |      t/        |      k7  s t        j)                  t        |              y|||k7  s t        j)                  t        |              y 	 t        j)                  t        |              y# t        j
                  j                  j                  $ r d}Y w xY w# t"        t$        j&                  f$ r" Y  t        j)                  t        |              yw xY w# t        j)                  t        |              w xY 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#   )r   r   _recursion_stackr   saorm
attributesinstance_stater   r   NO_STATElistr"   r$   r%   
isinstancer   AttributeErrorsa_excUnboundExecutionErrorr&   hasattrstrset)r   r.   self_keyabattrr   battrs           r   r-   zComparableMixin.__eq__2   s
    D=5??2d8''RX&.	. 66,,;;DAEE }%QZZ(??3'4(e%89!#At,E 5*-j6Lum4Wv>  ;$u+5#( ##BtH- u:U3#( ##BtH-	 (Ue^$ ##BtH-; )6 ##BtH-U 66::&&   2 '(D(DE !   ##BtH-#!" ##BtH-sz   3G AI  H
,AI 8I I 0I I I I 9I )HI HI 
I#I II  I(N)r   r'   r(   r/   r-   r)   r   r   r+   r+   .   s    &>.r   r+   c                      e Zd Zd Zy)ComparableEntityc                ,    t        | j                        S r
   )hashr   )r   s    r   __hash__zComparableEntity.__hash__t   s    DNN##r   N)r   r'   r(   rJ   r)   r   r   rG   rG   s   s    $r   rG   )
__future__r   
sqlalchemyr4    r   r<   orm.writeonlyr   r@   r   r   r3   r+   rG   r)   r   r   <module>rO      sI    #   /e) )0 5 B. B.J$ $r   