Ë
    V.jº„  ã                  óV  — d dl mZ d dlZd dlmZ d dlmZ d dlmZ d dlmZ d dlm	Z	 d dlm
Z
 d d	lmZ d d
lmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ  ddl!mZ ddl"m#Z# dd l$m%Z% dd!l&m'Z' erdd"l(m)Z) dd#l"m*Z* dd$l"m+Z+  ed%e	¬&«      Z,e'd'   Z-e%r	d(d)iZ.d*d)iZ/ni Z.i Z/ ej`                  dUd+d)ie.¤Ž G d,„ d-ee,   «      «       Z1 G d.„ d/ee1e,      «      Z2 G d0„ d1e jF                  e,   «      Z3 G d2„ d3e3e1e,      «      Z4 G d4„ d5e4e,   «      Z5 G d6„ d7e3ee1e,         «      Z6 G d8„ d9e6e,   «      Z7 G d:„ d;e4e8   «      Z9 G d<„ d=e4e8   «      Z: G d>„ d?e4e   «      Z; G d@„ dAe4e   «      Z< G dB„ dCe4e   «      Z= G dD„ dEe4e   «      Z> G dF„ dGe6e8   «      Z? G dH„ dIe6e8   «      Z@ G dJ„ dKe6e   «      ZA G dL„ dMe6e   «      ZB G dN„ dOe6e   «      ZC G dP„ dQe6e   «      ZDdRZEdSZFdVdT„ZGy)Wé    )Ú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)z()ú[)z(]z[]ÚslotsTÚkw_onlyÚfrozenc                  óˆ  — e Zd ZU dZdZded<   	 dZded<   	 er1 ej                  d¬«      Z
ded	<    ej                  d
¬«      Zded<   n2 ej                  d-ddie¤ŽZ
ded	<    ej                  d-dd
ie¤ŽZded<   es	 	 d.dd
dœ	 	 	 	 	 	 	 d/d„Zd0d„Zed0d„«       Zed0d„«       Zed0d„«       Zed0d„«       Zed0d„«       Zed0d„«       Zed1d„«       Zd2d„Zd3d„Z	 d4	 	 	 	 	 	 	 	 	 	 	 d5d„Zd6d„Zd7d„Zd8d„Zd7d„Zd7d„ZeZ d7d „Z!e!Z"d7d!„Z#d7d"„Z$	 	 	 	 	 	 	 	 	 	 d9d#„Z%d7d$„Z&d:d%„Z'd:d&„Z(d:d'„Z)d:d(„Z*d:d)„Z+d:d*„Z,d;d+„Z-d;d,„Z.y)<Ú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Úupperr(   )ÚdefaultÚ_BoundsTypeÚboundsFÚboolÚemptyr1   )r3   r5   c               óD   — | j                   j                  ||||dœ«       y )N)r/   r0   r3   r5   )Ú__dict__Úupdate)Úselfr/   r0   r3   r5   s        úgC:\xampp\htdocs\tradingbinance\backend\.venv\Lib\site-packages\sqlalchemy/dialects/postgresql/ranges.pyÚ__init__zRange.__init__a   s'   € ð �M‰M× Ñ à"Ø"Ø$Ø"ñ	õó    c                ó   — | j                    S ©N©r5   ©r9   s    r:   Ú__bool__zRange.__bool__s   s   € Ø—:‘:ˆ~Ðr<   c                ó   — | j                   S ©z$A synonym for the 'empty' attribute.r?   r@   s    r:   ÚisemptyzRange.isemptyv   ó   € ð �z‰zÐr<   c                ó   — | j                   S rC   r?   r@   s    r:   Úis_emptyzRange.is_empty|   rE   r<   c                ó&   — | j                   d   dk(  S )z,Return True if the lower bound is inclusive.r   Ú[©r3   r@   s    r:   Ú	lower_inczRange.lower_inc‚   ó   € ð �{‰{˜1‰~ Ñ$Ð$r<   c                ó<   — | j                    xr | j                  du S )zKReturn True if this range is non-empty and lower bound is
        infinite.N)r5   r/   r@   s    r:   Ú	lower_infzRange.lower_infˆ   ó   € ð
 —:‘:ˆ~Ò4 $§*¡*°Ð"4Ð4r<   c                ó&   — | j                   d   dk(  S )z,Return True if the upper bound is inclusive.r   Ú]rJ   r@   s    r:   Ú	upper_inczRange.upper_inc�   rL   r<   c                ó<   — | j                    xr | j                  du S )zOReturn True if this range is non-empty and the upper bound is
        infinite.N)r5   r0   r@   s    r:   Ú	upper_infzRange.upper_inf•   rO   r<   c                ó   — t        «       S r>   )ÚAbstractSingleRanger@   s    r:   Ú__sa_type_engine__zRange.__sa_type_engine__œ   s   € ä"Ó$Ð$r<   c                óð  — | j                   ry| j                  €@| j                  du xs0 | j                  d   dk(  r|| j                  k  S || j                  k  S | j                  €0| j                  d   dk(  r|| j                  kD  S || j                  k\  S | j                  d   dk(  r|| j                  kD  n|| j                  k\  xr0 | j                  d   dk(  r|| j                  k  S || j                  k  S )z3Return True if this range contains the given value.FNr   Ú)r   Ú()r5   r/   r0   r3   ©r9   Úvalues     r:   Ú_contains_valuezRange._contains_value    s  € ð �:Š:Øà�:‰:ÐØ—:‘: Ð%ò à—;‘;˜q‘> SÒ(ð ˜Ÿ
™
Ñ"ðð ˜dŸj™jÑ(ðð �:‰:Ðð —;‘;˜q‘> SÒ(ð ˜Ÿ
™
Ñ"ðð ˜dŸj™jÑ(ðð �{‰{˜1‰~ Ò$ð �D—J‘JÒà˜$Ÿ*™*Ñ$ò
ð �{‰{˜1‰~ Ò$ð �D—J‘JÑð	
ð ˜$Ÿ*™*Ñ$ð	
r<   c                óX  — t        | j                  t        «      st        | j                  t        «      ryt        | j                  t        «      st        | j                  t        «      ryt        | j                  t
        «      st        | j                  t
        «      rt        d¬«      S y)uA   Determine the â€œstepâ€� for this range, if it is a discrete one.r   N)Údays)Ú
isinstancer/   Úintr0   r   r   r   r@   s    r:   Ú_get_discrete_stepzRange._get_discrete_step¾   sn   € ô �d—j‘j¤#Ô&¬*°T·Z±ZÄÔ*EØÜ˜Ÿ
™
¤HÔ-´Ø�J‰Jœô2
ð
 Ü˜Ÿ
™
¤DÔ)¬Z¸¿
¹
ÄDÔ-IÜ !Ô$Ð$àr<   c                óf  — |dv }|dv }||cxu r€n n||k(  ry|rdS dS |€|rdS dS |€|rdS dS ||k(  r||k(  ry|dv }|dv }	| j                  «       }
|
�*|r
|s||
z  }d}n	|r||
z  }d}|r
|	s||
z  }d}	n	|	r||
z  }d}	||k  ry||kD  ry|ry|r|	ry|s|	s||k(  ry|rdS dS |s|rdS dS |	s|rdS dS y)a  Compare 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.
        >   rZ   rI   r   éÿÿÿÿr   >   rI   rQ   TF)rb   )r9   Úvalue1Úbound1Úvalue2Úbound2Úonly_valuesÚvalue1_is_lower_boundÚvalue2_is_lower_boundÚ
value1_incÚ
value2_incÚsteps              r:   Ú_compare_edgeszRange._compare_edgesÒ   sN  € ð" !'¨*Ð 4ÐØ &¨*Ð 4Ðð �V×#Ø$Ð(=Ò=Øá2�rÐ9¸Ð9Øˆ^Ù.�2Ð5°AÐ5Øˆ^Ù-�1Ð5°2Ð5ð �VÒ ¨&Ò 0Øà˜zÐ)ˆ
Ø˜zÐ)ˆ
Ø×&Ñ&Ó(ˆàÐñ %Ù!Ø˜d‘N�FØ!%‘JáØ˜d‘N�FØ!&�JÙ$Ù!Ø˜d‘N�FØ!%‘JáØ˜d‘N�FØ!&�Jà�FŠ?ØØ�fŠ_ØÙØñ ™jØÙ©
Ø(Ð,AÒAØá 5˜1Ð=¸2Ð=ÙÙ1�qÐ9°rÐ9ÙÙ2�rÐ9¸Ð9àr<   c                óÌ  — t        |t        «      st        S | j                  r|j                  ry| j                  |j                  k7  ry| j                  }| j
                  d   }|j                  }|j
                  d   }| j                  }| j
                  d   }|j                  }|j
                  d   }	| j                  ||||«      dk(  xr | j                  ||||	«      dk(  S )z€Compare this range to the `other` taking into account
        bounds inclusivity, returning ``True`` if they are equal.
        TFr   r   )r`   r-   ÚNotImplementedr5   r/   r3   r0   ro   ©
r9   ÚotherÚslowerÚslower_bÚolowerÚolower_bÚsupperÚsupper_bÚoupperÚoupper_bs
             r:   Ú__eq__zRange.__eq__+  sÎ   € ô
 ˜%¤Ô'Ü!Ð!à�:Š:˜%Ÿ+š+ØØ�Z‰Z˜5Ÿ;™;Ò&Øà—‘ˆØ—;‘;˜q‘>ˆØ—‘ˆØ—<‘< ‘?ˆØ—‘ˆØ—;‘;˜q‘>ˆØ—‘ˆØ—<‘< ‘?ˆð ×Ñ ¨°&¸(ÓCÀqÑHò MØ×#Ñ# F¨H°f¸hÓGÈ1ÑLð	
r<   c                óp  — | j                   ry|j                   ry| j                  }| j                  d   }|j                  }|j                  d   }| j                  ||||«      dk  ry| j                  }| j                  d   }|j                  }|j                  d   }	| j                  ||||	«      dkD  ryy)z7Determine whether this range is a contained by `other`.TFr   r   )r5   r/   r3   ro   r0   rr   s
             r:   Úcontained_byzRange.contained_byF  s­   € ð �:Š:Øð �;Š;Øà—‘ˆØ—;‘;˜q‘>ˆØ—‘ˆØ—<‘< ‘?ˆà×Ñ˜v x°¸ÓBÀQÒFØà—‘ˆØ—;‘;˜q‘>ˆØ—‘ˆØ—<‘< ‘?ˆà×Ñ˜v x°¸ÓBÀQÒFØàr<   c                óf   — t        |t        «      r|j                  | «      S | j                  |«      S )z.Determine whether this range contains `value`.)r`   r-   r~   r]   r[   s     r:   ÚcontainszRange.containsc  s0   € ô �eœUÔ#Ø×%Ñ% dÓ+Ð+à×'Ñ'¨Ó.Ð.r<   c                óÊ  — | j                   s|j                   ry| j                  }| j                  d   }| j                  }| j                  d   }|j                  }|j                  d   }|j                  }|j                  d   }	| j	                  ||||«      dk\  r| j	                  ||||	«      dk  ry| j	                  ||||«      dk\  r| j	                  ||||«      dk  ryy)z3Determine whether this range overlaps with `other`.Fr   r   T©r5   r/   r3   r0   ro   ©
r9   rs   rt   ru   rx   ry   rv   rw   rz   r{   s
             r:   ÚoverlapszRange.overlapsk  sÝ   € ð �:Š:˜ŸšØà—‘ˆØ—;‘;˜q‘>ˆØ—‘ˆØ—;‘;˜q‘>ˆØ—‘ˆØ—<‘< ‘?ˆØ—‘ˆØ—<‘< ‘?ˆð ×Ñ ¨°&¸(ÓCÀqÒHØ×#Ñ# F¨H°f¸hÓGÈ1ÒLàð ×Ñ ¨°&¸(ÓCÀqÒHØ×#Ñ# F¨H°f¸hÓGÈ1ÒLààr<   c                óÎ   — | j                   s|j                   ry| j                  }| j                  d   }|j                  }|j                  d   }| j	                  ||||«      dk  S )zBDetermine whether this range is completely to the left of `other`.Fr   r   )r5   r0   r3   r/   ro   )r9   rs   rx   ry   rv   rw   s         r:   Ústrictly_left_ofzRange.strictly_left_of‹  ó^   € ð �:Š:˜ŸšØà—‘ˆØ—;‘;˜q‘>ˆØ—‘ˆØ—<‘< ‘?ˆð ×"Ñ" 6¨8°V¸XÓFÈÑJÐJr<   c                óÎ   — | j                   s|j                   ry| j                  }| j                  d   }|j                  }|j                  d   }| j	                  ||||«      dkD  S )zCDetermine whether this range is completely to the right of `other`.Fr   r   r‚   )r9   rs   rt   ru   rz   r{   s         r:   Ústrictly_right_ofzRange.strictly_right_ofœ  r‡   r<   c                óÎ   — | j                   s|j                   ry| j                  }| j                  d   }|j                  }|j                  d   }| j                  ||||«      dk\  S )z>Determine whether this does not extend to the left of `other`.Fr   )r5   r/   r3   ro   )r9   rs   rt   ru   rv   rw   s         r:   Únot_extend_left_ofzRange.not_extend_left_of­  ó^   € ð �:Š:˜ŸšØà—‘ˆØ—;‘;˜q‘>ˆØ—‘ˆØ—<‘< ‘?ˆð ×"Ñ" 6¨8°V¸XÓFÈ!ÑKÐKr<   c                óÎ   — | j                   s|j                   ry| j                  }| j                  d   }|j                  }|j                  d   }| j                  ||||«      dk  S )z?Determine whether this does not extend to the right of `other`.Fr   r   )r5   r0   r3   ro   )r9   rs   rx   ry   rz   r{   s         r:   Únot_extend_right_ofzRange.not_extend_right_of¼  rŒ   r<   c                ó<  — | j                  ||||d«      }|dk(  r<| j                  «       }|€y|dk(  r|dk(  r|||z
  k(  S ||k(  S |dk(  r||k(  S |||z
  k(  S |dk(  rA|dk(  r|dk(  s
|dk(  r|dk(  r| j                  «       }|�y|dk(  xr |dk(  xs |dk(  xr |dk(  S y)	zTDetermine whether an upper bound is immediately successive to a
        lower bound.Trd   FrQ   rI   r   rY   rZ   )ro   rb   )r9   re   rf   rg   rh   Úresrn   s          r:   Ú_upper_edge_adjacent_to_lowerz#Range._upper_edge_adjacent_to_lowerË  só   € ð ×!Ñ! &¨&°&¸&À$ÓGˆØ�"Š9Ø×*Ñ*Ó,ˆDØˆ|ØØ˜Š}Ø˜S’=Ø! V¨d¡]Ñ2Ð2à! VÑ+Ð+à˜S’=Ø! VÑ+Ð+à! V¨d¡]Ñ2Ð2Ø�AŠXð ˜#’Ø˜c’MØ˜S’=Ø˜c’Mà×.Ñ.Ó0�ØÐ#Øà˜#‘ò "Ø˜c‘Mò"à˜S‘=ò "Ø˜c‘Mð	ð r<   c                ó`  — | j                   s|j                   ry| j                  }| j                  d   }| j                  }| j                  d   }|j                  }|j                  d   }|j                  }|j                  d   }	| j	                  ||||«      xs | j	                  ||	||«      S )z8Determine whether this range is adjacent to the `other`.Fr   r   )r5   r/   r3   r0   r‘   rƒ   s
             r:   Úadjacent_tozRange.adjacent_toú  s¤   € ð �:Š:˜ŸšØà—‘ˆØ—;‘;˜q‘>ˆØ—‘ˆØ—;‘;˜q‘>ˆØ—‘ˆØ—<‘< ‘?ˆØ—‘ˆØ—<‘< ‘?ˆà×1Ñ1Ø�H˜f hó
ò 
à×/Ñ/Ø�H˜f hó
ð	
r<   c           	     ó*  — | j                   r|S |j                   r| S | j                  |«      s| j                  |«      st        d«      ‚| j                  }| j
                  d   }| j                  }| j
                  d   }|j                  }|j
                  d   }|j                  }|j
                  d   }	| j                  ||||«      dk  r|}
|}n|}
|}| j                  ||||	«      dkD  r|}|}n|}|	}t        |
|t        t        ||z   «      ¬«      S )z¾Compute 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 implementedr   r   rJ   )r5   r„   r“   Ú
ValueErrorr/   r3   r0   ro   r-   r	   r2   ©r9   rs   rt   ru   rx   ry   rv   rw   rz   r{   ÚrlowerÚrlower_bÚrupperÚrupper_bs                 r:   ÚunionzRange.union  s  € ð �:Š:ØˆLØ�;Š;ØˆKà�}‰}˜UÔ#¨D×,<Ñ,<¸UÔ,CÜð-óð ð
 —‘ˆØ—;‘;˜q‘>ˆØ—‘ˆØ—;‘;˜q‘>ˆØ—‘ˆØ—<‘< ‘?ˆØ—‘ˆØ—<‘< ‘?ˆà×Ñ˜v x°¸ÓBÀQÒFØˆFØ‰HàˆFØˆHà×Ñ˜v x°¸ÓBÀQÒFØˆFØ‰HàˆFØˆHäØ�F¤4¬°XÀÑ5HÓ#Iô
ð 	
r<   c                ó$   — | j                  |«      S r>   )r›   ©r9   rs   s     r:   Ú__add__zRange.__add__>  s   € Ø�z‰z˜%Ó Ð r<   c           	     óÒ  — | j                   s|j                   r| S | j                  }| j                  d   }| j                  }| j                  d   }|j                  }|j                  d   }|j                  }|j                  d   }	| j	                  ||||«      }
| j	                  ||||	«      }|
dk  r|dkD  rt        d«      ‚| j	                  ||||	«      }| j	                  ||||«      }|dkD  s|dk  r| S |
dk\  r|dk  rt        ddd¬«      S |
dk  ra|dk\  r\|dk  rW|dk(  rdnd	}|dk7  r*|d	k7  r%| j	                  ||||«      dk(  rt        ddd¬«      S t        ||t        t        ||z   «      ¬
«      S |
dk\  ra|dk\  r\|dk  rW|	d	k(  rdnd}|dk7  r*|d	k7  r%| j	                  ||||«      dk(  rt        ddd¬«      S t        ||t        t        ||z   «      ¬
«      S J d| › d|› �«       ‚)zÇCompute 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.
        r   r   z5Subtracting a strictly inner range is not implementedNTr?   rI   rY   rQ   rJ   rZ   zUnhandled case computing z - )	r5   r/   r3   r0   ro   r•   r-   r	   r2   )r9   rs   rt   ru   rx   ry   rv   rw   rz   r{   Úsl_vs_olÚsu_vs_ouÚsl_vs_ouÚsu_vs_olrš   r˜   s                   r:   Ú
differencezRange.differenceA  s0  € ð �:Š:˜ŸšØˆKà—‘ˆØ—;‘;˜q‘>ˆØ—‘ˆØ—;‘;˜q‘>ˆØ—‘ˆØ—<‘< ‘?ˆØ—‘ˆØ—<‘< ‘?ˆà×&Ñ& v¨x¸ÀÓJˆØ×&Ñ& v¨x¸ÀÓJˆØ�aŠ<˜H qšLÜØGóð ð ×&Ñ& v¨x¸ÀÓJˆØ×&Ñ& v¨x¸ÀÓJˆð �aŠ<˜8 aš<ØˆKð �qŠ=˜X¨š]Ü˜˜t¨4Ô0Ð0ð �qŠ=˜X¨š]¨x¸1ª}Ø&¨#šo‘s°3ˆHà˜C’Ø ’OØ×'Ñ'¨°¸&À(ÓKØòô ˜T 4¨tÔ4Ð4äØØÜ¤¨X¸Ñ-@ÓAôð ð �qŠ=˜X¨š]¨x¸1ª}Ø&¨#šo‘s°3ˆHà˜C’Ø ’OØ×'Ñ'¨°¸&À(ÓKØòô ˜T 4¨tÔ4Ð4äØØÜ¤¨X¸Ñ-@ÓAôð ð 	CÐ1°$°°s¸5¸'ÐBÓBˆur<   c                ó$   — | j                  |«      S r>   )r¤   r�   s     r:   Ú__sub__zRange.__sub__�  s   € Ø�‰˜uÓ%Ð%r<   c           	     ó  — | j                   s|j                   s| j                  |«      st        ddd¬«      S | j                  }| j                  d   }| j
                  }| j                  d   }|j                  }|j                  d   }|j
                  }|j                  d   }	| j                  ||||«      dk  r|}
|}n|}
|}| j                  ||||	«      dkD  r|}|	}n|}|}t        |
|t        t        ||z   «      ¬«      S )zdCompute the intersection of this range with the `other`.

        .. versionadded:: 2.0.10

        NTr?   r   r   rJ   )	r5   r„   r-   r/   r3   r0   ro   r	   r2   r–   s                 r:   ÚintersectionzRange.intersection�  sÿ   € ð �:Š:˜Ÿš¨D¯M©M¸%Ô,@Ü˜˜t¨4Ô0Ð0à—‘ˆØ—;‘;˜q‘>ˆØ—‘ˆØ—;‘;˜q‘>ˆØ—‘ˆØ—<‘< ‘?ˆØ—‘ˆØ—<‘< ‘?ˆà×Ñ˜v x°¸ÓBÀQÒFØˆFØ‰HàˆFØˆHà×Ñ˜v x°¸ÓBÀQÒFØˆFØ‰HàˆFØˆHäØØÜœ X°Ñ%8Ó9ô
ð 	
r<   c                ó$   — | j                  |«      S r>   )r¨   r�   s     r:   Ú__mul__zRange.__mul__¶  s   € Ø× Ñ  Ó'Ð'r<   c                ó"   — | j                  «       S r>   )Ú
_stringifyr@   s    r:   Ú__str__zRange.__str__¹  s   € Ø�‰Ó Ð r<   c                ó¬   — | j                   ry| j                  | j                  }}|€dn|}|€dn|}t        d| j                  «      \  }}|› |› d|› |› �S )Nr5   Ú zTuple[str, str]Ú,)r5   r/   r0   r	   r3   )r9   ÚlÚrÚb0Úb1s        r:   r¬   zRange._stringify¼  sa   € Ø�:Š:Øà�z‰z˜4Ÿ:™:ˆ1ˆØ�)‰B ˆØ�)‰B ˆäÐ'¨¯©Ó5‰ˆˆBà��a�S˜˜!˜˜R˜DÐ!Ð!r<   © )NN)r/   r.   r0   r.   r3   r2   r5   r4   )Úreturnr4   )r¶   zAbstractSingleRange[_T])r\   r&   r¶   r4   )r¶   r   )F)re   r.   rf   Ústrrg   r.   rh   r·   ri   r4   r¶   ra   )rs   r   r¶   r4   )rs   ú	Range[_T]r¶   r4   )r\   zUnion[_T, Range[_T]]r¶   r4   )
re   r.   rf   r·   rg   r.   rh   r·   r¶   r4   )rs   r¸   r¶   r¸   )r¶   r·   )/Ú__name__Ú
__module__Ú__qualname__Ú__doc__r/   Ú__annotations__r0   r   ÚdataclassesÚfieldr3   r5   Ú	dc_kwonlyr!   r;   rA   ÚpropertyrD   rG   rK   rN   rR   rT   rW   r]   rb   ro   r|   r~   r€   r„   r†   Ú
__lshift__r‰   Ú
__rshift__r‹   rŽ   r‘   r“   r›   rž   r¤   r¦   r¨   rª   r­   r¬   rµ   r<   r:   r-   r-   ;   s_  … ñð* €Eˆ<ÓØà€Eˆ<ÓØáØ/˜k×/Ñ/¸Ô=ˆ�Ó=Ø'�k×'Ñ'°Ô6ˆˆtÔ6à/˜k×/Ñ/ÑJ¸ÐJÀ	ÑJˆ�ÓJØ'�k×'Ñ'ÑC°ÐC¸ÑCˆˆtÓCáð #'Ø"&ð	ð
 #'Øñ	àð	ð  ð	ð
  ð	ð ó	ó$ð òó ðð
 òó ðð
 ò%ó ð%ð
 ò5ó ð5ð ò%ó ð%ð
 ò5ó ð5ð ò%ó ð%ó
ó<ð4 "ðWàðWð ðWð ð	Wð
 ðWð ðWð 
óWór
ó6ó:/óó@Kð "€JóKð #€JóLóLð-àð-ð ð-ð ð	-ð
 ð-ð 
ó-ó^
ó,,
ó\!óJCóX&ó$
óL(ó!ô
"r<   r-   c                  ó"   — e Zd ZdZedd„«       Zy)Ú
MultiRangea?  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                ó   — t        «       S r>   )ÚAbstractMultiRanger@   s    r:   rW   zMultiRange.__sa_type_engine__Þ  s   € ä!Ó#Ð#r<   N)r¶   zAbstractMultiRange[_T])r¹   rº   r»   r¼   rÁ   rW   rµ   r<   r:   rÅ   rÅ   É  s   „ ñð( ò$ó ñ$r<   rÅ   c                  óž   ‡ — e Zd ZdZdZdZedd„«       Ze	 	 	 	 	 	 d	d„«       Z	 	 	 	 	 	 d
ˆ fd„Z G d„ dej                  e
e      «      Zˆ xZS )ÚAbstractRangez0Base class for single and multi Range SQL types.Tc                 ó   — y r>   rµ   ©r9   ÚclsÚkws      r:   ÚadaptzAbstractRange.adaptê  s   € Ø7:r<   c                 ó   — y r>   rµ   rË   s      r:   rÎ   zAbstractRange.adaptí  s   € ð r<   c                óÈ   •— t        |t        t        f«      r=|| j                  ur/| j                  } t        |› d�|| j                  fd|i«      «       S t        ‰| �  |«      S )a	  Dynamically 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Î   )r9   rÌ   rÍ   Ú
visit_namerÖ   s       €r:   rÎ   zAbstractRange.adaptò  st   ø€ ô �sÔ4Ô6LÐMÔNØ˜4Ÿ>™>Ñ)ð ×,Ñ,ˆJð”4Ø�,˜iÐ(Ø�d—n‘nÐ%Ø! :Ð.óó ð ô ‘7‘= Ó%Ð%r<   c                  óp   — e Zd ZdZdd„Zdd„Zdd„Zdd„ZeZdd„Z	e	Z
dd„Zdd„Zdd	„Zdd
„Zdd„Zdd„Zy)ú AbstractRange.comparator_factoryz-Define comparison operations for range types.c                óB   — | j                   j                  t        |«      S )a
  Boolean 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   )r9   rs   rÍ   s      r:   r€   z)AbstractRange.comparator_factory.contains  s   € ð —9‘9×$Ñ$¤X¨uÓ5Ð5r<   c                óB   — | j                   j                  t        |«      S )zsBoolean expression. Returns true if the column is contained
            within the right hand operand.
            )rÝ   rÞ   r   r�   s     r:   r~   z-AbstractRange.comparator_factory.contained_by!  s   € ð —9‘9×$Ñ$¤\°5Ó9Ð9r<   c                óB   — | j                   j                  t        |«      S )z„Boolean expression. Returns true if the column overlaps
            (has points in common with) the right hand operand.
            )rÝ   rÞ   r   r�   s     r:   r„   z)AbstractRange.comparator_factory.overlaps'  s   € ð —9‘9×$Ñ$¤W¨eÓ4Ð4r<   c                óB   — | j                   j                  t        |«      S )zsBoolean expression. Returns true if the column is strictly
            left of the right hand operand.
            )rÝ   rÞ   r   r�   s     r:   r†   z1AbstractRange.comparator_factory.strictly_left_of-  s   € ð —9‘9×$Ñ$Ô%5°uÓ=Ð=r<   c                óB   — | j                   j                  t        |«      S )ztBoolean expression. Returns true if the column is strictly
            right of the right hand operand.
            )rÝ   rÞ   r   r�   s     r:   r‰   z2AbstractRange.comparator_factory.strictly_right_of5  s   € ð —9‘9×$Ñ$Ô%6¸Ó>Ð>r<   c                óB   — | j                   j                  t        |«      S )z‡Boolean expression. Returns true if the range in the column
            does not extend right of the range in the operand.
            )rÝ   rÞ   r   r�   s     r:   rŽ   z4AbstractRange.comparator_factory.not_extend_right_of=  s   € ð —9‘9×$Ñ$Ô%8¸%Ó@Ð@r<   c                óB   — | j                   j                  t        |«      S )z†Boolean expression. Returns true if the range in the column
            does not extend left of the range in the operand.
            )rÝ   rÞ   r   r�   s     r:   r‹   z3AbstractRange.comparator_factory.not_extend_left_ofC  s   € ð —9‘9×$Ñ$Ô%7¸Ó?Ð?r<   c                óB   — | j                   j                  t        |«      S )z}Boolean expression. Returns true if the range in the column
            is adjacent to the range in the operand.
            )rÝ   rÞ   r   r�   s     r:   r“   z,AbstractRange.comparator_factory.adjacent_toI  s   € ð —9‘9×$Ñ$¤[°%Ó8Ð8r<   c                óV   — | j                   j                  t        j                  |«      S ©z�Range expression. Returns the union of the two ranges.
            Will raise an exception if the resulting range is not
            contiguous.
            )rÝ   rÞ   r   Úaddr�   s     r:   r›   z&AbstractRange.comparator_factory.unionO  ó   € ð
 —9‘9×$Ñ$¤Y§]¡]°EÓ:Ð:r<   c                óV   — | j                   j                  t        j                  |«      S rç   )rÝ   rÞ   r   Úsubr�   s     r:   r¤   z+AbstractRange.comparator_factory.differenceV  ré   r<   c                óV   — | j                   j                  t        j                  |«      S )z¤Range expression. Returns the intersection of the two ranges.
            Will raise an exception if the resulting range is not
            contiguous.
            )rÝ   rÞ   r   Úmulr�   s     r:   r¨   z-AbstractRange.comparator_factory.intersection]  ré   r<   N)rs   r   rÍ   r   r¶   úColumnElement[bool])rs   r   r¶   rî   )rs   r   r¶   zColumnElement[Range[_T]])r¹   rº   r»   r¼   r€   r~   r„   r†   rÂ   r‰   rÃ   rŽ   r‹   r“   r›   r¤   r¨   rµ   r<   r:   Úcomparator_factoryrÛ     sL   „ Ù;ó	6ó	:ó	5ó	>ð &ˆ
ó	?ð 'ˆ
ó	Aó	@ó	9ó	;ó	;ô	;r<   rï   )rÌ   z	Type[_TE]rÍ   r   r¶   r$   )rÌ   zType[TypeEngineMixin]rÍ   r   r¶   úTypeEngine[Any])rÌ   z-Type[Union[TypeEngine[Any], TypeEngineMixin]]rÍ   r   r¶   rð   )r¹   rº   r»   r¼   Úrender_bind_castÚ__abstract__r   rÎ   r    Ú
Comparatorr-   r   rï   Ú__classcell__)rÖ   s   @r:   rÉ   rÉ   ã  sŽ   ø„ Ù:àÐà€LàÚ:ó Ø:àðØ(ðØ03ðà	òó ðð &à:ð &ð ð &ð 
õ	 &ôDN;˜Z×2Ñ2°5¸±:Ñ>÷ N;ð N;r<   rÉ   c                  ó   — e Zd ZdZdZdd„Zy)rV   zòBase 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                óœ  — |j                   �|j                   n|j                  }t        |t        «      rt	        |«      r
t        «       S t        «       S t        |t        t        f«      r
t        «       S t        |t        «      r |j                  s
t        «       S t        «       S t        |t        «      r
t        «       S t         j"                  S r>   )r/   r0   r`   ra   Ú	_is_int32Ú	INT4RANGEÚ	INT8RANGEr   ÚfloatÚNUMRANGEr   ÚtzinfoÚTSRANGEÚ	TSTZRANGEr   Ú	DATERANGEÚsqltypesÚNULLTYPE)r9   r\   Úspecs      r:   Ú_resolve_for_literalz(AbstractSingleRange._resolve_for_literalr  s”   € Ø#Ÿk™kÐ5ˆu�{Š{¸5¿;¹;ˆä�dœCÔ ô ˜ÔÜ “{Ð"ä “{Ð"Ü˜œw¬Ð.Ô/Ü“:ÐÜ˜œhÔ'Ø$(§K¢K”7“9Ð@´Y³[Ð@Ü˜œdÔ#Ü“;Ðô ×$Ñ$Ð$r<   N)r\   z
Range[Any]r¶   r   ©r¹   rº   r»   r¼   rò   r  rµ   r<   r:   rV   rV   e  s   „ ñð €Lô%r<   rV   c                  ó   — e Zd ZdZy)rÔ   zQMarker for AbstractSingleRange that will apply a subclass-specific
    adaptationN©r¹   rº   r»   r¼   rµ   r<   r:   rÔ   rÔ   ˆ  ó   „ òr<   rÔ   c                  ó   — e Zd ZdZdZdd„Zy)rÇ   z‚Base for PostgreSQL MULTIRANGE types.

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

    Tc                óØ  — |st         j                  S |d   }|j                  �|j                  n|j                  }t	        |t
        «      r&t        d„ |D «       «      r
t        «       S t        «       S t	        |t        t        f«      r
t        «       S t	        |t        «      r |j                  s
t        «       S t        «       S t	        |t         «      r
t#        «       S t         j                  S )Nr   c              3  ó2   K  — | ]  }t        |«      –— Œ y ­wr>   )r÷   )Ú.0r²   s     r:   Ú	<genexpr>z:AbstractMultiRange._resolve_for_literal.<locals>.<genexpr>¢  s   è ø€ Ð/© A”9˜Q—<©ùs   ‚)r   r  r/   r0   r`   ra   ÚallÚINT4MULTIRANGEÚINT8MULTIRANGEr   rú   ÚNUMMULTIRANGEr   rü   ÚTSMULTIRANGEÚTSTZMULTIRANGEr   ÚDATEMULTIRANGE)r9   r\   Úfirstr  s       r:   r  z'AbstractMultiRange._resolve_for_literal—  s¶   € Ùä×$Ñ$Ð$Ø�a‘ˆØ#Ÿk™kÐ5ˆu�{Š{¸5¿;¹;ˆä�dœCÔ ô Ñ/©Ó/Ô/Ü%Ó'Ð'ä%Ó'Ð'Ü˜œw¬Ð.Ô/Ü “?Ð"Ü˜œhÔ'Ø)-¯ª”<“>ÐJ¼.Ó:JÐJÜ˜œdÔ#Ü!Ó#Ð#ô ×$Ñ$Ð$r<   N)r\   zSequence[Range[Any]]r¶   r   r  rµ   r<   r:   rÇ   rÇ   �  s   „ ñð €Lô%r<   rÇ   c                  ó   — e Zd ZdZy)rÕ   zPMarker for AbstractMultiRange that will apply a subclass-specific
    adaptationNr  rµ   r<   r:   rÕ   rÕ   ±  r  r<   rÕ   c                  ó   — e Zd ZdZd Zy)rø   z(Represent the PostgreSQL INT4RANGE type.N©r¹   rº   r»   r¼   rÒ   rµ   r<   r:   rø   rø   ¶  ó
   „ Ù2à �Nr<   rø   c                  ó   — e Zd ZdZd Zy)rù   z(Represent the PostgreSQL INT8RANGE type.Nr  rµ   r<   r:   rù   rù   ¼  r  r<   rù   c                  ó   — e Zd ZdZd Zy)rû   z'Represent the PostgreSQL NUMRANGE type.Nr  rµ   r<   r:   rû   rû   Â  s
   „ Ù1à�Nr<   rû   c                  ó   — e Zd ZdZd Zy)rÿ   z(Represent the PostgreSQL DATERANGE type.Nr  rµ   r<   r:   rÿ   rÿ   È  r  r<   rÿ   c                  ó   — e Zd ZdZd Zy)rý   ú&Represent the PostgreSQL TSRANGE type.Nr  rµ   r<   r:   rý   rý   Î  s
   „ Ù0à�Nr<   rý   c                  ó   — e Zd ZdZd Zy)rþ   ú(Represent the PostgreSQL TSTZRANGE type.Nr  rµ   r<   r:   rþ   rþ   Ô  r  r<   rþ   c                  ó   — e Zd ZdZd Zy)r  z-Represent the PostgreSQL INT4MULTIRANGE type.Nr  rµ   r<   r:   r  r  Ú  ó
   „ Ù7à%�Nr<   r  c                  ó   — e Zd ZdZd Zy)r  z-Represent the PostgreSQL INT8MULTIRANGE type.Nr  rµ   r<   r:   r  r  à  r!  r<   r  c                  ó   — e Zd ZdZd Zy)r  z,Represent the PostgreSQL NUMMULTIRANGE type.Nr  rµ   r<   r:   r  r  æ  s
   „ Ù6à$�Nr<   r  c                  ó   — e Zd ZdZd Zy)r  z-Represent the PostgreSQL DATEMULTIRANGE type.Nr  rµ   r<   r:   r  r  ì  r!  r<   r  c                  ó   — e Zd ZdZd Zy)r  r  Nr  rµ   r<   r:   r  r  ò  s
   „ Ù0à#�Nr<   r  c                  ó   — e Zd ZdZd Zy)r  r  Nr  rµ   r<   r:   r  r  ø  s
   „ Ù2à%�Nr<   r  iÿÿÿi   €c                óÎ   — | j                   d u xs" t        | j                   cxk  xr	 t        k  nc xr2 | j                  d u xs" t        | j                  cxk  xr	 t        k  S c S r>   )r/   Ú_min_int_32Ú_max_int_32r0   )r²   s    r:   r÷   r÷     sP   € Ø�G‰G�tˆOÒDœ{¨a¯g©gÖD¼ÔDò Ø	�‰�4ˆÒ@œ;¨!¯'©'Ö@´[Ñ@ðÙ@ðr<   rµ   )r²   z
Range[int]r¶   r4   )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   r   ÚsqlÚsql.type_apir    Úutilr!   Úutil.typingr"   Úsql.elementsr#   r$   r%   r&   r2   Údc_slotsrÀ   Ú	dataclassr-   rÅ   rÉ   rV   rÔ   rÇ   rÕ   ra   rø   rù   rû   rÿ   rý   rþ   r  r  r  r  r  r  r)  r(  r÷   rµ   r<   r:   Ú<module>r4     sK  ðõ #ã Ý Ý Ý Ý Ý Ý Ý Ý Ý Ý Ý Ý Ý Ý  Ý Ý å "Ý #Ý Ý )Ý *Ý Ý 'Ý (Ý !Ý Ý &Ý Ý "áÝ-Ý#Ý/áˆT˜Ô€àÐ,Ñ-€áØ˜ˆ€HØ˜DÐ!�Ià€HØ€Ið €×ÑÑ/˜dÐ/ hÑ/ôJ
"ˆG�B‰Kó J
"ó 0ðJ
"ôZ$��e˜B‘i‘ô $ô4;�H×'Ñ'¨Ñ+ô ;ôD %˜-¨¨b©	Ñ2ô  %ôFÐ1°"Ñ5ô ô
!%˜ x°°b±	Ñ':Ñ;ô !%ôHÐ/°Ñ3ô ô
!Ð# CÑ(ô !ô!Ð# CÑ(ô !ô Ð" 7Ñ+ô  ô!Ð# DÑ)ô !ôÐ! (Ñ+ô ô!Ð# HÑ-ô !ô&Ð'¨Ñ,ô &ô&Ð'¨Ñ,ô &ô%Ð& wÑ/ô %ô&Ð'¨Ñ-ô &ô$Ð% hÑ/ô $ô&Ð'¨Ñ1ô &ð €Ø€ôr<   