+
    Xj                    4   ^ RI Ht ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIH	t	 ^ RIH
t
 ^ R	IHt ^ R
IHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt  ^RI!Ht ^RI"H#t# ^RI$H%t% ^RI&H't' ]'       d   ^R I(H)t) ^R!I"H*t* ^R"I"H+t+ ]! R#]	R$7      t,]'RQ,          t-]%'       d
   R%R&/t.R'R&/t/M/ t./ t/]P`                  ! RRR(R&/].B  ! R) R*]],,          4      4       t1 ! R+ R,]]1],,          ,          4      t2 ! R- R.] PF                  ],,          4      t3 ! R/ R0]3]1],,          ,          4      t4 ! R1 R2]4],,          4      t5 ! R3 R4]3]]1],,          ,          ,          4      t6 ! R5 R6]6],,          4      t7 ! R7 R8]4]8,          4      t9 ! R9 R:]4]8,          4      t: ! R; R<]4],          4      t; ! R= R>]4],          4      t< ! R? R@]4],          4      t= ! RA RB]4],          4      t> ! RC RD]6]8,          4      t? ! RE RF]6]8,          4      t@ ! RG RH]6],          4      tA ! RI RJ]6],          4      tB ! RK RL]6],          4      tC ! RM RN]6],          4      tDRStERTtFRO RP ltGR# )U    )annotationsN)date)datetime)	timedelta)Decimal)Any)cast)Generic)List)Optional)overload)Sequence)Tuple)Type)TYPE_CHECKING)TypeVar)Union)ADJACENT_TO)CONTAINED_BY)CONTAINS)NOT_EXTEND_LEFT_OF)NOT_EXTEND_RIGHT_OF)OVERLAP)STRICTLY_LEFT_OF)STRICTLY_RIGHT_OF)types)	operators)
TypeEngine)py310)Literal)ColumnElement)_TE)TypeEngineMixin_T)boundslotsTkw_onlyfrozenc                    a  ] tR t^;t0 o $ RtRtR]R&    RtR]R&    ]'       d2   ]	P                  ! RR7      tR]R	&   ]	P                  ! R
R7      tR]R&   M2]	P                  ! RJRR/]B tR]R	&   ]	P                  ! RJRR
/]B tR]R&   ]'       g   RKR	RRR
/R R llltR R lt]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       tR  R! ltR" R# ltRLR$ R% lltR& R' ltR( R) ltR* R+ lt]tR, R- lt R. R/ lt!]!t"R0 R1 lt#]#t$R2 R3 lt%R4 R5 lt&R6 R7 lt'R8 R9 lt(R: R; lt)R< R= lt*R> R? lt+R@ RA lt,RB RC lt-RD RE lt.RF RG lt/RH RI lt0RJt1R# )MRangea+  Represent a PostgreSQL range.

E.g.::

    r = Range(10, 50, bounds="()")

The calling style is similar to that of psycopg and psycopg2, in part
to allow easier migration from previous SQLAlchemy versions that used
these objects directly.

:param lower: Lower bound value, or None
:param upper: Upper bound value, or None
:param bounds: keyword-only, optional string value that is one of
 ``"()"``, ``"[)"``, ``"(]"``, ``"[]"``.  Defaults to ``"[)"``.
:param empty: keyword-only, optional bool indicating this is an "empty"
 range

.. versionadded:: 2.0

NOptional[_T]lowerupper[))default_BoundsTypeboundsFboolemptyr/   c               (    V ^8  d   QhRRRRRRRR/# )   r,   r+   r-   r1   r0   r3   r2    )formats   "   /Users/wind/Downloads/Coruna-main学习资料A/backend/venv/lib/python3.14/site-packages/sqlalchemy/dialects/postgresql/ranges.py__annotate__Range.__annotate__a   s2     	 		  	
  	 	    c          
     	L    V P                   P                  R VRVRVRV/4       R# )r,   r-   r1   r3   N)__dict__update)selfr,   r-   r1   r3   s   &&&$$r8   __init__Range.__init__a   s/     MM  UUfU	r;   c                   V ^8  d   QhRR/# r5   returnr2   r6   )r7   s   "r8   r9   r:   s   s      $ r;   c                	$    V P                   '       * # Nr3   r?   s   &r8   __bool__Range.__bool__s   s    ::~r;   c                   V ^8  d   QhRR/# rC   r6   )r7   s   "r8   r9   r:   w   s       r;   c                    V P                   # z$A synonym for the 'empty' attribute.rG   rH   s   &r8   isemptyRange.isemptyv        zzr;   c                   V ^8  d   QhRR/# rC   r6   )r7   s   "r8   r9   r:   }   s      $ r;   c                    V P                   # rM   rG   rH   s   &r8   is_emptyRange.is_empty|   rP   r;   c                   V ^8  d   QhRR/# rC   r6   )r7   s   "r8   r9   r:           % %4 %r;   c                .    V P                   ^ ,          R8H  # )z,Return True if the lower bound is inclusive.[r1   rH   s   &r8   	lower_incRange.lower_inc        {{1~$$r;   c                   V ^8  d   QhRR/# rC   r6   )r7   s   "r8   r9   r:           5 54 5r;   c                P    V P                   '       * ;'       d    V P                  RJ # )zCReturn True if this range is non-empty and lower bound is
infinite.N)r3   r,   rH   s   &r8   	lower_infRange.lower_inf   !    
 ::~44$**"44r;   c                   V ^8  d   QhRR/# rC   r6   )r7   s   "r8   r9   r:      rV   r;   c                .    V P                   ^,          R8H  # )z,Return True if the upper bound is inclusive.]rY   rH   s   &r8   	upper_incRange.upper_inc   r\   r;   c                   V ^8  d   QhRR/# rC   r6   )r7   s   "r8   r9   r:      r^   r;   c                P    V P                   '       * ;'       d    V P                  RJ # )zGReturn True if this range is non-empty and the upper bound is
infinite.N)r3   r-   rH   s   &r8   	upper_infRange.upper_inf   rb   r;   c                   V ^8  d   QhRR/# )r5   rD   zAbstractSingleRange[_T]r6   )r7   s   "r8   r9   r:      s     % %$; %r;   c                	    \        4       # rF   )AbstractSingleRangerH   s   &r8   __sa_type_engine__Range.__sa_type_engine__   s    "$$r;   c                    V ^8  d   QhRRRR/# )r5   valuer$   rD   r2   r6   )r7   s   "r8   r9   r:      s     
 
R 
D 
r;   c                >   V P                   '       d   R# V P                  fK   V P                  RJ ;'       g5    V P                  ^,          R8X  d   WP                  8  # WP                  8*  # V P                  f5   V P                  ^ ,          R8X  d   WP                  8  # WP                  8  # V P                  ^ ,          R8X  d   WP                  8  MWP                  8  ;'       d5    V P                  ^,          R8X  d   WP                  8  # WP                  8*  # )z3Return True if this range contains the given value.FN)()r3   r,   r-   r1   r?   rr   s   &&r8   _contains_valueRange._contains_value   s    :::::::%  ;;q>S( 

" jj( :: ;;q>S( 

" jj( {{1~$ JJ**$
 
 {{1~$ JJ	
 **$	
r;   c                   V ^8  d   QhRR/# )r5   rD   r   r6   )r7   s   "r8   r9   r:      s      C r;   c                   \        V P                  \        4      '       g!   \        V P                  \        4      '       d   ^# \        V P                  \        4      '       g!   \        V P                  \        4      '       d   R# \        V P                  \
        4      '       g!   \        V P                  \
        4      '       d   \        ^R7      # R# )uA   Determine the “step” for this range, if it is a discrete one.N)days)
isinstancer,   intr-   r   r   r   rH   s   &r8   _get_discrete_stepRange._get_discrete_step   s     djj#&&*TZZ*E*E

H--JJ2
 2

 

D))Z

D-I-I!$$r;   c               0    V ^8  d   QhRRRRRRRRRRR	R
/# )r5   value1r+   bound1strvalue2bound2only_valuesr2   rD   r}   r6   )r7   s   "r8   r9   r:      sN     W WW W 	W
 W W 
Wr;   c                   VR9   pVR9   pYu;J d   f   M MWg8X  d   ^ # V'       d   R# ^# Vf   V'       d   R# ^# Vf   V'       d   ^# R# W$8X  d	   W8X  d   ^ # VR9   pVR9   p	V P                  4       p
V
e[   V'       d   V'       g   W,          pRpMV'       d   W,          pRpV'       d   V	'       g   W:,          pRp	MV	'       d   W:,          pRp	W8  d   R# W8  d   ^# V'       d   ^ # V'       d   V	'       d   ^ # V'       g   V	'       g   Wg8X  d   ^ # V'       d   ^# R# V'       g   V'       d   ^# R# V	'       g   V'       d   R# ^# ^ # )zCompare two range bounds.

Return -1, 0 or 1 respectively when `value1` is less than,
equal to or greater than `value2`.

When `only_value` is ``True``, do not consider the *inclusivity*
of the edges, just their values.
TF>   ru   rX   >   rX   re   )r~   )r?   r   r   r   r   r   value1_is_lower_boundvalue2_is_lower_bound
value1_inc
value2_incsteps   &&&&&&     r8   _compare_edgesRange._compare_edges   s=   " !'* 4 &* 4 ##$=2r99^.25A5^-1525  0z)
z)
&&( %!NF!%JNF!&J$!NF!%JNF!&J?I_ j
(A 51=2=1q9r92r99r;   c                    V ^8  d   QhRRRR/# )r5   otherr   rD   r2   r6   )r7   s   "r8   r9   r:   +  s     
 
C 
D 
r;   c                   \        V\        4      '       g   \        # V P                  '       d   VP                  '       d   R# V P                  VP                  8w  d   R# V P                  pV P
                  ^ ,          pVP                  pVP
                  ^ ,          pV P                  pV P
                  ^,          pVP                  pVP
                  ^,          p	V P                  W#WE4      ^ 8H  ;'       d    V P                  WgW4      ^ 8H  # )zpCompare this range to the `other` taking into account
bounds inclusivity, returning ``True`` if they are equal.
TF)r|   r*   NotImplementedr3   r,   r1   r-   r   
r?   r   slowerslower_bolowerolower_bsuppersupper_boupperoupper_bs
   &&        r8   __eq__Range.__eq__+  s    
 %''!!:::%+++ZZ5;;&;;q><<?;;q><<? &CqH M M##FfG1L	
r;   c                    V ^8  d   QhRRRR/# r5   r   	Range[_T]rD   r2   r6   )r7   s   "r8   r9   r:   F  s      )  r;   c                   V P                   '       d   R# VP                   '       d   R# V P                  pV P                  ^ ,          pVP                  pVP                  ^ ,          pV P                  W#WE4      ^ 8  d   R# V P                  pV P                  ^,          pVP                  pVP                  ^,          p	V P                  WgW4      ^ 8  d   R# R# )z7Determine whether this range is a contained by `other`.TF)r3   r,   r1   r   r-   r   s
   &&        r8   contained_byRange.contained_byF  s     ::: ;;;;;q><<?vBQF;;q><<?vBQFr;   c                    V ^8  d   QhRRRR/# )r5   rr   zUnion[_T, Range[_T]]rD   r2   r6   )r7   s   "r8   r9   r:   c  s     / /2 /t /r;   c                r    \        V\        4      '       d   VP                  V 4      # V P                  V4      # )z.Determine whether this range contains `value`.)r|   r*   r   rw   rv   s   &&r8   containsRange.containsc  s3     eU##%%d++''..r;   c                    V ^8  d   QhRRRR/# r   r6   )r7   s   "r8   r9   r:   m  s      i D r;   c                
   V P                   '       g   VP                   '       d   R# V P                  pV P                  ^ ,          pV P                  pV P                  ^,          pVP                  pVP                  ^ ,          pVP                  pVP                  ^,          p	V P	                  W#Wg4      ^ 8  d   V P	                  W#W4      ^ 8:  d   R# V P	                  WgW#4      ^ 8  d   V P	                  WgWE4      ^ 8:  d   R# R# )z3Determine whether this range overlaps with `other`.FTr3   r,   r1   r-   r   
r?   r   r   r   r   r   r   r   r   r   s
   &&        r8   overlapsRange.overlapsm  s     :::;;q>;;q><<?<<? &CqH##FfG1L &CqH##FfG1Lr;   c                    V ^8  d   QhRRRR/# r   r6   )r7   s   "r8   r9   r:     s     K Ki KD Kr;   c                    V P                   '       g   VP                   '       d   R# V P                  pV P                  ^,          pVP                  pVP                  ^ ,          pV P	                  W#WE4      ^ 8  # )zBDetermine whether this range is completely to the left of `other`.F)r3   r-   r1   r,   r   )r?   r   r   r   r   r   s   &&    r8   strictly_left_ofRange.strictly_left_of  ^     :::;;q><<? ""6VFJJr;   c                    V ^8  d   QhRRRR/# r   r6   )r7   s   "r8   r9   r:     s     K Ky KT Kr;   c                    V P                   '       g   VP                   '       d   R# V P                  pV P                  ^ ,          pVP                  pVP                  ^,          pV P	                  W#WE4      ^ 8  # )zCDetermine whether this range is completely to the right of `other`.Fr   )r?   r   r   r   r   r   s   &&    r8   strictly_right_ofRange.strictly_right_of  r   r;   c                    V ^8  d   QhRRRR/# r   r6   )r7   s   "r8   r9   r:     s     L L	 Ld Lr;   c                    V P                   '       g   VP                   '       d   R# V P                  pV P                  ^ ,          pVP                  pVP                  ^ ,          pV P                  W#WE4      ^ 8  # )z>Determine whether this does not extend to the left of `other`.F)r3   r,   r1   r   )r?   r   r   r   r   r   s   &&    r8   not_extend_left_ofRange.not_extend_left_of  ^     :::;;q><<? ""6VF!KKr;   c                    V ^8  d   QhRRRR/# r   r6   )r7   s   "r8   r9   r:     s     L L Lt Lr;   c                    V P                   '       g   VP                   '       d   R# V P                  pV P                  ^,          pVP                  pVP                  ^,          pV P                  W#WE4      ^ 8*  # )z?Determine whether this does not extend to the right of `other`.F)r3   r-   r1   r   )r?   r   r   r   r   r   s   &&    r8   not_extend_right_ofRange.not_extend_right_of  r   r;   c          
     ,    V ^8  d   QhRRRRRRRRRR/# )	r5   r   r+   r   r   r   r   rD   r2   r6   )r7   s   "r8   r9   r:     s<     - -- - 	-
 - 
-r;   c                   V P                  WW4R4      pVR8X  dJ   V P                  4       pVf   R# VR8X  d   VR8X  d   WV,
          8H  # W8H  # VR8X  d   W8H  # WV,
          8H  # V^ 8X  d_   VR8X  d   VR8X  g   VR8X  d   VR8X  d   V P                  4       pVe   R# VR8H  ;'       d    VR8H  ;'       g    VR8H  ;'       d    VR8H  # R# )zLDetermine whether an upper bound is immediately successive to a
lower bound.TFre   rX   rt   ru   r   )r   r~   )r?   r   r   r   r   resr   s   &&&&&  r8   _upper_edge_adjacent_to_lower#Range._upper_edge_adjacent_to_lower  s     !!&&$G"9**,D|}S=!d]22!++S=!++!d]22AX #cMS=cM..0## " "cM" "S= " "cM	 r;   c                    V ^8  d   QhRRRR/# r   r6   )r7   s   "r8   r9   r:     s     
 
 
t 
r;   c                   V P                   '       g   VP                   '       d   R# V P                  pV P                  ^ ,          pV P                  pV P                  ^,          pVP                  pVP                  ^ ,          pVP                  pVP                  ^,          p	V P	                  WEWg4      ;'       g    V P	                  WW#4      # )z8Determine whether this range is adjacent to the `other`.F)r3   r,   r1   r-   r   r   s
   &&        r8   adjacent_toRange.adjacent_to  s     :::;;q>;;q><<?<<?11f
 
 
//f
	
r;   c                    V ^8  d   QhRRRR/# r5   r   r   rD   r6   )r7   s   "r8   r9   r:     s     ,
 ,
9 ,
 ,
r;   c           	     ~   V P                   '       d   V# VP                   '       d   V # V P                  V4      '       g#   V P                  V4      '       g   \        R4      hV P                  pV P
                  ^ ,          pV P                  pV P
                  ^,          pVP                  pVP
                  ^ ,          pVP                  pVP
                  ^,          p	V P                  W#Wg4      ^ 8  d   Tp
TpMTp
TpV P                  WEW4      ^ 8  d   TpTpMTpT	p\        W\        \        W,           4      R7      # )zCompute the union of this range with the `other`.

This raises a ``ValueError`` exception if the two ranges are
"disjunct", that is neither adjacent nor overlapping.
zAAdding non-overlapping and non-adjacent ranges is not implementedrY   )r3   r   r   
ValueErrorr,   r1   r-   r   r*   r	   r0   r?   r   r   r   r   r   r   r   r   r   rlowerrlower_brupperrupper_bs   &&            r8   unionRange.union  s    :::L;;;K}}U##D,<,<U,C,C- 
 ;;q>;;q><<?<<?vBQFFHFHvBQFFHFH4X5H#I
 	
r;   c                    V ^8  d   QhRRRR/# r   r6   )r7   s   "r8   r9   r:   @  s     ! !Y !9 !r;   c                	$    V P                  V4      # rF   )r   r?   r   s   &&r8   __add__Range.__add__@  s    zz%  r;   c                    V ^8  d   QhRRRR/# r   r6   )r7   s   "r8   r9   r:   C  s"     JC JC	 JCi JCr;   c           	     N   V P                   '       g   VP                   '       d   V # V P                  pV P                  ^ ,          pV P                  pV P                  ^,          pVP                  pVP                  ^ ,          pVP                  pVP                  ^,          p	V P	                  W#Wg4      p
V P	                  WEW4      pV
^ 8  d   V^ 8  d   \        R4      hV P	                  W#W4      pV P	                  WEWg4      pV^ 8  g   V^ 8  d   V # V
^ 8  d   V^ 8:  d   \        RRRR7      # V
^ 8:  do   V^ 8  dh   V^ 8:  da   VR8X  d   RMRpVR8w  d-   VR8w  d&   V P	                  W#Wn4      ^ 8X  d   \        RRRR7      # \        VV\        \        W>,           4      R7      # V
^ 8  do   V^ 8  dh   V^ 8:  da   V	R8X  d   R	MRpVR8w  d-   VR8w  d&   V P	                  WWE4      ^ 8X  d   \        RRRR7      # \        VV\        \        W,           4      R7      # Q R
T  RT 24       h)zCompute the difference between this range and the `other`.

This raises a ``ValueError`` exception if the two ranges are
"disjunct", that is neither adjacent nor overlapping.
z5Subtracting a strictly inner range is not implementedNTrG   rX   rt   re   rY   ru   zUnhandled case computing z - )	r3   r,   r1   r-   r   r   r*   r	   r0   )r?   r   r   r   r   r   r   r   r   r   sl_vs_olsu_vs_ousl_vs_ousu_vs_olr   r   s   &&              r8   
differenceRange.differenceC  s    :::K;;q>;;q><<?<<?&&vJ&&vJa<HqLG  &&vJ&&vJ a<8a<K q=X]t400 q=X]x1}&#os3HCO''&K T4t44X-@A  q=X]x1}&#os3HCO''&K T4t44X-@A  	C1$s5'BBur;   c                    V ^8  d   QhRRRR/# r   r6   )r7   s   "r8   r9   r:     s     & &Y &9 &r;   c                	$    V P                  V4      # rF   )r   r   s   &&r8   __sub__Range.__sub__  s    u%%r;   c                    V ^8  d   QhRRRR/# r   r6   )r7   s   "r8   r9   r:     s     $
 $
) $
	 $
r;   c           	     P   V P                   '       g*   VP                   '       g   V P                  V4      '       g   \        RRRR7      # V P                  pV P                  ^ ,          pV P
                  pV P                  ^,          pVP                  pVP                  ^ ,          pVP
                  pVP                  ^,          p	V P                  W#Wg4      ^ 8  d   Tp
TpMTp
TpV P                  WEW4      ^ 8  d   TpT	pMTpTp\        V
V\        \        W,           4      R7      # )zTCompute the intersection of this range with the `other`.

.. versionadded:: 2.0.10

NTrG   rY   )	r3   r   r*   r,   r1   r-   r   r	   r0   r   s   &&            r8   intersectionRange.intersection  s     :::DMM%,@,@t400;;q>;;q><<?<<?vBQFFHFHvBQFFHFHX%89
 	
r;   c                    V ^8  d   QhRRRR/# r   r6   )r7   s   "r8   r9   r:     s     ( (Y (9 (r;   c                	$    V P                  V4      # rF   )r   r   s   &&r8   __mul__Range.__mul__  s      ''r;   c                   V ^8  d   QhRR/# r5   rD   r   r6   )r7   s   "r8   r9   r:     s     ! ! !r;   c                	"    V P                  4       # rF   )
_stringifyrH   s   &r8   __str__Range.__str__  s      r;   c                   V ^8  d   QhRR/# r   r6   )r7   s   "r8   r9   r:     s     
" 
"C 
"r;   c                	    V P                   '       d   R # V P                  V P                  r!Vf   RMTpVf   RMTp\        RV P                  4      w  r4V V RV V 2# )r3    zTuple[str, str],)r3   r,   r-   r	   r1   )r?   lrb0b1s   &    r8   r   Range._stringify  s_    :::zz4::1)B)B'5aS!RD!!r;   r6   )NN)F)2__name__
__module____qualname____firstlineno____doc__r,   __annotations__r-   r   dataclassesfieldr1   r3   	dc_kwonlyr   r@   rI   propertyrN   rS   rZ   r`   rf   rj   ro   rw   r~   r   r   r   r   __contains__r   r   
__lshift__r   
__rshift__r   r   r   r   r   r   r   r   r   r   r   r   __static_attributes__)__conditional_annotations__s   @r8   r*   r*   ;   s    * E<E<)//==!''6t6)//JJ	JJ!''CCCtC	
 #'	  	 	$  
  
 % %
 5 5 % %
 5 5 % %
<(Wr
6:/ L@K "JK #JLL-^
,,
\!JCX&$
L(!
" 
"r;   r*   c                  0    ] tR tRtRt]R R l4       tRtR# )
MultiRangei  a  Represents a multirange sequence.

This list subclass is an utility to allow automatic type inference of
the proper multi-range SQL type depending on the single range values.
This is useful when operating on literal multi-ranges::

    import sqlalchemy as sa
    from sqlalchemy.dialects.postgresql import MultiRange, Range

    value = literal(MultiRange([Range(2, 4)]))

    select(tbl).where(tbl.c.value.op("@")(MultiRange([Range(-3, 7)])))

.. versionadded:: 2.0.26

.. seealso::

    - :ref:`postgresql_multirange_list_use`.
c                   V ^8  d   QhRR/# )r5   rD   zAbstractMultiRange[_T]r6   )r7   s   "r8   r9   MultiRange.__annotate__  s     $ $$: $r;   c                	    \        4       # rF   )AbstractMultiRangerH   s   &r8   ro   MultiRange.__sa_type_engine__  s    !##r;   r6   N)r   r   r   r   r  r  ro   r
  r6   r;   r8   r  r    s    ( $ $r;   r  c                     a  ] tR tRtRtRtRt]R R l4       t]R R l4       tR V 3R	 llt ! R
 R]	P                  ]],          ,          4      tRtV ;t# )AbstractRangei  z0Base class for single and multi Range SQL types.Tc               $    V ^8  d   QhRRRRRR/# )r5   clsz	Type[_TE]kwr   rD   r"   r6   )r7   s   "r8   r9   AbstractRange.__annotate__  s    :::#:#:r;   c                	    R # rF   r6   r?   r  r  s   &&,r8   adaptAbstractRange.adapt  s    7:r;   c               $    V ^8  d   QhRRRRRR/# )r5   r  zType[TypeEngineMixin]r  r   rD   TypeEngine[Any]r6   )r7   s   "r8   r9   r    s$      (03	r;   c                	    R # rF   r6   r  s   &&,r8   r  r    s     r;   c               $    V ^8  d   QhRRRRRR/# )r5   r  z-Type[Union[TypeEngine[Any], TypeEngineMixin]]r  r   rD   r  r6   )r7   s   "r8   r9   r    s(      &  &: &  & 
	 &r;   c                   < \        V\        \        34      '       d>   WP                  Jd/   V P                  p\        V R2WP                  3RV/4      ! 4       # \        SV `  V4      # )zDynamically adapt a range type to an abstract impl.

For example ``INT4RANGE().adapt(_Psycopg2NumericRange)`` should
produce a type that will have ``_Psycopg2NumericRange`` behaviors
and also render as ``INT4RANGE`` in SQL and DDL.

	RangeImpl__visit_name__)
issubclassAbstractSingleRangeImplAbstractMultiRangeImpl	__class__r#  typesuperr  )r?   r  r  
visit_namer'  s   &&, r8   r  r    so     s46LMNN>>) ,,J,i(nn%!:.   7=%%r;   c                      ] tR tRtRtR R ltR R ltR R ltR	 R
 lt]t	R R lt
]
tR R ltR R ltR R ltR R ltR R ltR R ltRtR# ) AbstractRange.comparator_factoryi  z-Define comparison operations for range types.c               $    V ^8  d   QhRRRRRR/# )r5   r   r   r  rD   ColumnElement[bool]r6   )r7   s   "r8   r9   -AbstractRange.comparator_factory.__annotate__  s"     	6 	6# 	6S 	65H 	6r;   c                B    V P                   P                  \        V4      # )zBoolean expression. Returns true if the right hand operand,
which can be an element or a range, is contained within the
column.

kwargs may be ignored by this operator but are required for API
conformance.
)exproperater   )r?   r   r  s   &&,r8   r   )AbstractRange.comparator_factory.contains  s     99$$Xu55r;   c                    V ^8  d   QhRRRR/# r5   r   r   rD   r.  r6   )r7   s   "r8   r9   r/  #  s     	: 	:c 	:.A 	:r;   c                B    V P                   P                  \        V4      # )z[Boolean expression. Returns true if the column is contained
within the right hand operand.
)r1  r2  r   r   s   &&r8   r   -AbstractRange.comparator_factory.contained_by#  s     99$$\599r;   c                    V ^8  d   QhRRRR/# r5  r6   )r7   s   "r8   r9   r/  )  s     	5 	5# 	5*= 	5r;   c                B    V P                   P                  \        V4      # )zlBoolean expression. Returns true if the column overlaps
(has points in common with) the right hand operand.
)r1  r2  r   r   s   &&r8   r   )AbstractRange.comparator_factory.overlaps)  s     99$$We44r;   c                    V ^8  d   QhRRRR/# r5  r6   )r7   s   "r8   r9   r/  /  s     	> 	># 	>2E 	>r;   c                B    V P                   P                  \        V4      # )z[Boolean expression. Returns true if the column is strictly
left of the right hand operand.
)r1  r2  r   r   s   &&r8   r   1AbstractRange.comparator_factory.strictly_left_of/  s     99$$%5u==r;   c                    V ^8  d   QhRRRR/# r5  r6   )r7   s   "r8   r9   r/  7  s     	? 	?3 	?3F 	?r;   c                B    V P                   P                  \        V4      # )z\Boolean expression. Returns true if the column is strictly
right of the right hand operand.
)r1  r2  r   r   s   &&r8   r   2AbstractRange.comparator_factory.strictly_right_of7  s     99$$%6>>r;   c                    V ^8  d   QhRRRR/# r5  r6   )r7   s   "r8   r9   r/  ?  s     	A 	AS 	A5H 	Ar;   c                B    V P                   P                  \        V4      # )zoBoolean expression. Returns true if the range in the column
does not extend right of the range in the operand.
)r1  r2  r   r   s   &&r8   r   4AbstractRange.comparator_factory.not_extend_right_of?  s     99$$%8%@@r;   c                    V ^8  d   QhRRRR/# r5  r6   )r7   s   "r8   r9   r/  E  s     	@ 	@C 	@4G 	@r;   c                B    V P                   P                  \        V4      # )znBoolean expression. Returns true if the range in the column
does not extend left of the range in the operand.
)r1  r2  r   r   s   &&r8   r   3AbstractRange.comparator_factory.not_extend_left_ofE  s     99$$%7??r;   c                    V ^8  d   QhRRRR/# r5  r6   )r7   s   "r8   r9   r/  K  s     	9 	9S 	9-@ 	9r;   c                B    V P                   P                  \        V4      # )zeBoolean expression. Returns true if the range in the column
is adjacent to the range in the operand.
)r1  r2  r   r   s   &&r8   r   ,AbstractRange.comparator_factory.adjacent_toK  s     99$$[%88r;   c                    V ^8  d   QhRRRR/# r5  r6   )r7   s   "r8   r9   r/  Q  s     	; 	;s 	;': 	;r;   c                V    V P                   P                  \        P                  V4      # zyRange expression. Returns the union of the two ranges.
Will raise an exception if the resulting range is not
contiguous.
)r1  r2  r   addr   s   &&r8   r   &AbstractRange.comparator_factory.unionQ      
 99$$Y]]E::r;   c                    V ^8  d   QhRRRR/# r5  r6   )r7   s   "r8   r9   r/  X  s     	; 	;C 	;,? 	;r;   c                V    V P                   P                  \        P                  V4      # rL  )r1  r2  r   subr   s   &&r8   r   +AbstractRange.comparator_factory.differenceX  rO  r;   c                    V ^8  d   QhRRRR/# )r5   r   r   rD   zColumnElement[Range[_T]]r6   )r7   s   "r8   r9   r/  _  s     	; 	;c 	;.F 	;r;   c                V    V P                   P                  \        P                  V4      # )zRange expression. Returns the intersection of the two ranges.
Will raise an exception if the resulting range is not
contiguous.
)r1  r2  r   mulr   s   &&r8   r   -AbstractRange.comparator_factory.intersection_  rO  r;   r6   N)r   r   r   r   r  r   r   r   r   r  r   r	  r   r   r   r   r   r   r
  r6   r;   r8   comparator_factoryr,    sQ    ;	6	:	5	> &
	? '
	A	@	9	;	;	; 	;r;   rX  r6   )r   r   r   r   r  render_bind_cast__abstract__r   r  r   
Comparatorr*   r   rX  r
  __classcell__)r'  s   @r8   r  r    s_    :L: :  &  &DN;Z225:> N; N;r;   r  c                  *    ] tR tRtRtRtR R ltRtR# )rn   ig  zBase for PostgreSQL RANGE types.

These are types that return a single :class:`_postgresql.Range` object.

.. seealso::

    `PostgreSQL range functions <https://www.postgresql.org/docs/current/static/functions-range.html>`_

Tc                    V ^8  d   QhRRRR/# )r5   rr   z
Range[Any]rD   r   r6   )r7   s   "r8   r9    AbstractSingleRange.__annotate__t  s     % %* % %r;   c                	   VP                   e   VP                   MVP                  p\        V\        4      '       d&   \	        V4      '       d   \        4       # \        4       # \        V\        \        34      '       d   \        4       # \        V\        4      '       d'   VP                  '       g   \        4       # \        4       # \        V\        4      '       d   \        4       # \         P"                  # rF   )r,   r-   r|   r}   	_is_int32	INT4RANGE	INT8RANGEr   floatNUMRANGEr   tzinfoTSRANGE	TSTZRANGEr   	DATERANGEsqltypesNULLTYPE)r?   rr   specs   && r8   _resolve_for_literal(AbstractSingleRange._resolve_for_literalt  s    #kk5u{{5;;dC    {" {"w.//:h''$(KKK79@Y[@d##; $$$r;   r6   Nr   r   r   r   r  rZ  rm  r
  r6   r;   r8   rn   rn   g  s     L% %r;   rn   c                      ] tR tRtRtRtR# )r%  i  zMMarker for AbstractSingleRange that will apply a subclass-specific
adaptationr6   Nr   r   r   r   r  r
  r6   r;   r8   r%  r%        r;   r%  c                  *    ] tR tRtRtRtR R ltRtR# )r  i  zvBase for PostgreSQL MULTIRANGE types.

these are types that return a sequence of :class:`_postgresql.Range`
objects.

Tc                    V ^8  d   QhRRRR/# )r5   rr   zSequence[Range[Any]]rD   r   r6   )r7   s   "r8   r9   AbstractMultiRange.__annotate__  s     % %*> %3 %r;   c                	|   V'       g   \         P                  # V^ ,          pVP                  e   VP                  MVP                  p\	        V\
        4      '       dO   \        ;QJ d    R V 4       F  '       d   K   RM	  RM! R V 4       4      '       d   \        4       # \        4       # \	        V\        \        34      '       d   \        4       # \	        V\        4      '       d'   VP                  '       g   \        4       # \        4       # \	        V\         4      '       d   \#        4       # \         P                  # )r   c              3  8   "   T F  p\        V4      x  K  	  R # 5irF   )ra  ).0r   s   & r8   	<genexpr>:AbstractMultiRange._resolve_for_literal.<locals>.<genexpr>  s     /A9Q<<s   FT)rj  rk  r,   r-   r|   r}   allINT4MULTIRANGEINT8MULTIRANGEr   rd  NUMMULTIRANGEr   rf  TSMULTIRANGETSTZMULTIRANGEr   DATEMULTIRANGE)r?   rr   firstrl  s   &&  r8   rm  'AbstractMultiRange._resolve_for_literal  s    $$$a#kk5u{{5;;dC   s//sss////%''%''w.// ?"h'')-<>J.:JJd##!## $$$r;   r6   Nro  r6   r;   r8   r  r    s     L% %r;   r  c                      ] tR tRtRtRtR# )r&  i  zLMarker for AbstractMultiRange that will apply a subclass-specific
adaptationr6   Nrq  r6   r;   r8   r&  r&    rr  r;   r&  c                      ] tR tRtRtR tRtR# )rb  i  z(Represent the PostgreSQL INT4RANGE type.r6   Nr   r   r   r   r  r#  r
  r6   r;   r8   rb  rb    
    2 Nr;   rb  c                      ] tR tRtRtR tRtR# )rc  i  z(Represent the PostgreSQL INT8RANGE type.r6   Nr  r6   r;   r8   rc  rc    r  r;   rc  c                      ] tR tRtRtR tRtR# )re  i  z'Represent the PostgreSQL NUMRANGE type.r6   Nr  r6   r;   r8   re  re    s
    1Nr;   re  c                      ] tR tRtRtR tRtR# )ri  i  z(Represent the PostgreSQL DATERANGE type.r6   Nr  r6   r;   r8   ri  ri    r  r;   ri  c                      ] tR tRtRtR tRtR# )rg  i  &Represent the PostgreSQL TSRANGE type.r6   Nr  r6   r;   r8   rg  rg    s
    0Nr;   rg  c                      ] tR tRtRtR tRtR# )rh  i  (Represent the PostgreSQL TSTZRANGE type.r6   Nr  r6   r;   r8   rh  rh    r  r;   rh  c                      ] tR tRtRtR tRtR# )r|  i  z-Represent the PostgreSQL INT4MULTIRANGE type.r6   Nr  r6   r;   r8   r|  r|    
    7%Nr;   r|  c                      ] tR tRtRtR tRtR# )r}  i  z-Represent the PostgreSQL INT8MULTIRANGE type.r6   Nr  r6   r;   r8   r}  r}    r  r;   r}  c                      ] tR tRtRtR tRtR# )r~  i  z,Represent the PostgreSQL NUMMULTIRANGE type.r6   Nr  r6   r;   r8   r~  r~    s
    6$Nr;   r~  c                      ] tR tRtRtR tRtR# )r  i  z-Represent the PostgreSQL DATEMULTIRANGE type.r6   Nr  r6   r;   r8   r  r    r  r;   r  c                      ] tR tRtRtR tRtR# )r  i  r  r6   Nr  r6   r;   r8   r  r    s
    0#Nr;   r  c                      ] tR tRtRtR tRtR# )r  i  r  r6   Nr  r6   r;   r8   r  r    s
    2%Nr;   r  c                    V ^8  d   QhRRRR/# )r5   r   z
Range[int]rD   r2   r6   )r7   s   "r8   r9   r9     s        r;   c                
   V P                   R J ;'       g1    \        V P                   u;8*  ;'       d
    \        8*  Mu ;'       d?    V P                  R J ;'       g)    \        V P                  u;8*  ;'       d
    \        8*  # u # rF   )r,   _min_int_32_max_int_32r-   )r   s   &r8   ra  ra    sa    GGtODD{aggDDD  	4@@;!''@@[@@r;   )z()r.   z(]z[]r6   ii   )H
__future__r   r  r   r   r   decimalr   typingr   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rj  sqlsql.type_apir   utilr   util.typingr    sql.elementsr!   r"   r#   r$   r0   dc_slotsr  	dataclassr*   r  r  rn   r%  r  r&  r}   rb  rc  re  ri  rg  rh  r|  r}  r~  r  r  r  r  r  ra  r6   r;   r8   <module>r     sI   #                   " #  ) *  ' ( !  &  "-#/T,-HD!IHI /d/h/L
"GBK L
" 0L
"^$eBi $4;H''+ ;D %-b	2  %F1"5 
!%xb	':; !%H/3 
!#C( !!#C( ! "7+  !#D) !!(+ !#H- !&', &&', &%&w/ %&'- &$%h/ $&'1 & r;   