B 4] @sPddlZddlmZddlmZeZGddde Z eZ Gddde Z dS) N)exc)compatc@seZdZddZddZdS) BasicEntitycKs&x |D]\}}t|||q WdS)N)itemssetattr)selfkwkeyvaluer N/opt/alt/python37/lib64/python3.7/site-packages/sqlalchemy/testing/entities.py__init__szBasicEntity.__init__c shttkrtSttz.djjdfddtj DfSt tXdS)Nz%s(%s)z, cs(g|] }|dsd|t|fqS)_z%s=%r) startswithgetattr).0r )rr r sz(BasicEntity.__repr__..) id _repr_stackobject__repr__add __class____name__joinsorted__dict__keysremove)rr )rr rs   zBasicEntity.__repr__N)r __module__ __qualname__rrr r r r rsrc@s$eZdZddZddZddZdS)ComparableEntitycCs t|jS)N)hashr)rr r r __hash__+szComparableEntity.__hash__cCs || S)N)__eq__)rotherr r r __ne__.szComparableEntity.__ne__c Cs||kr dS|j|jksdSt|tkr,dStt|z.ytjj|j}Wntjj j k rpd}YnX|dkr|}|}n|dk r|}|}n|}|}xt |j D]}| drqt||}yt||}Wnttjfk rdSXt|drPt|tjsPt|dr8t|ds8t |t |krNdSnt|t|krddSq|dk r||krdSqWdStt|XdS)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_stackrsaZormZ attributesZinstance_stater rZNO_STATElistrrrAttributeErrorsa_excZUnboundExecutionErrorhasattr isinstancerZ string_typessetr)rr&Zself_keyabattrr Zbattrr r r r%1sP       zComparableEntity.__eq__N)rr r!r$r'r%r r r r r"*sr") Z sqlalchemyr+rr.utilrr1rrrr*r"r r r r s