U kf @sjddlmZddlZddlmZddlmZe Z GdddZ e Z Gdd d Z Gd d d e e ZdS) ) annotationsN)exc)WriteOnlyCollectionc@seZdZddZddZdS) BasicEntitycKs"|D]\}}t|||qdSN)itemssetattr)selfkwkeyvaluerK/opt/hc_python/lib64/python3.8/site-packages/sqlalchemy/testing/entities.py__init__szBasicEntity.__init__c slttkrtSttz2djjdfddt j DfWSttXdS)Nz%s(%s)z, cs(g|] }|dsd|t|fqS)_z%s=%r) startswithgetattr).0r r rr s z(BasicEntity.__repr__..) id _repr_stackobject__repr__addremove __class____name__joinsorted__dict__keysrrrrrs     zBasicEntity.__repr__N)r __module__ __qualname__rrrrrrrsrc@seZdZddZddZdS)ComparableMixincCs || Sr)__eq__)r otherrrr__ne__/szComparableMixin.__ne__c Cs||kr dS|j|jksdSt|tkr,dStt|zTztjj|j }Wntjj j k rpd}YnX|dkr|}|}n|dk r|}|}n|}|}t |j D]}|drqt||}t|trqzt||}Wn$ttjfk rYWdSXt|drnt|tsnt|drPt|dsPt |t |krlWHdSnt|t|krW*dSq|dk r||krWdSqWdStt|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_stackrrsaZorm attributesZinstance_stater rZNO_STATElistr!rr isinstancerAttributeErrorsa_excZUnboundExecutionErrorhasattrstrset)r r'Zself_keyabattrr Zbattrrrrr&2sV         zComparableMixin.__eq__N)rr#r$r(r&rrrrr%.sr%c@seZdZddZdS)ComparableEntitycCs t|jSr)hashrrrrr__hash__tszComparableEntity.__hash__N)rr#r$r:rrrrr8ssr8) __future__rZ sqlalchemyr,rr1Z orm.writeonlyrr4rrr+r%r8rrrr s   E