Files
Home-AssistantConfig/deps/sqlalchemy/sql/__pycache__/annotation.cpython-34.pyc

43 lines
5.4 KiB
Plaintext
Raw Normal View History

2016-10-11 16:42:06 +00:00
<EFBFBD>
|<7C><>W<EFBFBD><00>@s<>dZddlmZddlmZGdd<00>de<00>ZiZddd <00>Zdd
d <00>Zd d <00>Z dd<00>Z
dd<00>Z dS)z<>The :class:`.Annotated` class and related routines; creates hash-equivalent
copies of SQL constructs which contain context-specific markers and
associations.
<EFBFBD>)<01>util<69>)<01> operatorsc@s<>eZdZdZdd<00>Zdd<00>Zdd<00>Zdd <00>Zd
d d d <00>Zdd<00>Z e
dd<00><00>Z dd<00>Z dd<00>Z dd<00>Zd
S)<18> Annotateda<64>clones a ClauseElement and applies an 'annotations' dictionary.
Unlike regular clones, this clone also mimics __hash__() and
__cmp__() of the original element so that it takes its place
in hashed collections.
A reference to the original element is maintained, for the important
reason of keeping its hash value current. When GC'ed, the
hash value may be reused, causing conflicts.
c Gsh|stj|<00>S|\}}yt|j}Wn$tk
rVt|j|<00>}YnXtj|<00>SdS)N)<06>object<63>__new__<5F>annotated_classes<65> __class__<5F>KeyError<6F>_new_annotation_type)<04>cls<6C>args<67>element<6E>values<65>r<00>?/tmp/pip-build-zkr322cu/sqlalchemy/sqlalchemy/sql/annotation.pyrs   zAnnotated.__new__cCs7|jj<00>|_||_||_t|<00>|_dS)N)<06>__dict__<5F>copy<70>_Annotated__element<6E> _annotations<6E>hash<73>_hash)<03>selfrrrrr<00>__init__-s  zAnnotated.__init__cCs)|jj<00>}|j|<00>|j|<00>S)N)rr<00>update<74>_with_annotations)rr<00>_valuesrrr<00> _annotate3s zAnnotated._annotatecCs4|jj|j<00>}|jj<00>|_||_|S)N)r rrrr)rr<00>clonerrrr8s zAnnotated._with_annotationsNTcCsT|dkr|jS|jj<00>}x|D]}|j|d<00>q)W|j|<00>SdS)N)rrr<00>popr)rrrr<00>vrrr<00> _deannotate>s   zAnnotated._deannotatecKs|jjj|||<00>S)N)rr <00>_compiler_dispatch)rZvisitor<6F>kwrrrr"Gs zAnnotated._compiler_dispatchcCs
|jjS)N)r<00> _constructor)rrrrr$KszAnnotated._constructorcCsL|jj<00>}||jkr"|S|jj|j<00>|j||j<00>SdS)N)r<00>_clonerrr r)rrrrrr%Os
zAnnotated._clonecCs|jS)N)r)rrrr<00>__hash__ZszAnnotated.__hash__cCsEt|jtj<00>r+|jjj||<00>St|<00>t|<00>kSdS)N)<07>
isinstancerrZColumnOperatorsr <00>__eq__r)r<00>otherrrrr(]szAnnotated.__eq__)<0F>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__rrrrr!r"<00>propertyr$r%r&r(rrrrrs       rNcs7<00><00><00>fdd<00><00>|dk r3<00>|<00>}n|S)z<>Deep copy the given ClauseElement, annotating each element
with the given annotations dictionary.
Elements within the exclude collection will be cloned but not annotated.
csq<00>r6t|d<00>r6|jj<00><00>r6|j<00>}n'<00>|jkrW|j<00><00>}n|}|jd<00><00>|S)N<> proxy_setr)<07>hasattrr/<00> intersectionr%rr<00>_copy_internals)<02>elem<65>newelem)<03> annotationsr<00>excluderrrqsz_deep_annotate.<locals>.cloneNr)rr5r6r)r5rr6r<00>_deep_annotatejs r7csCtj<00><00><00><00><00>fdd<00><00>|dk r?<00>|<00>}n|S)z2Deep copy the given element, removing annotations.cs]<00>s|<00>krQ|jd<00>dd<00>}|jd<00><00><01>sM|<00>|<n|S<>|SdS)NrrT)r!r2)r3r4)r<00>clonedrrrr<00>s z_deep_deannotate.<locals>.cloneN)rZ column_dict)rrr)rr8rr<00>_deep_deannotate<74>s
  r9cCs|j|<00>}|j<00>|S)a Annotate the given ClauseElement and copy its internals so that
internal objects refer to the new annotated object.
Basically used to apply a "dont traverse" annotation to a
selectable, without digging throughout the whole
structure wasting time.
)rr2)rr5rrr<00>_shallow_annotate<74>s
r:cCs<>t|t<00>r|S|tkr't|Sx+|jD] }|tkr1t|}Pq1q1Wtd|j||fi<00>t|<}|t<00>d|j<|S)Nz Annotated%s)<07>
issubclassrr<00>__mro__<5F>typer*<00>globals)r <00>base_clsZsuper_Zanno_clsrrrr <00>s  

r cCsF|g}x6|rA|j<00>}|j|j<00><00>t||<00>q WdS)N)r<00>extend<6E>__subclasses__r )Ztarget_hierarchyr?<00>stackr rrr<00>_prepare_annotations<6E>s
   rC) r-<00>rrrrrr7r9r:r rCrrrr<00><module> sU