ó
    Ð]jÓ  ã                  ó~   • S SK Jr  S SKJr  S SKJr  S SKJr  \" S5      r " S S\\   5      r	 " S S	5      r
SS
 jrg)é    )Úannotations)Údeque)Úislice)ÚTypeVarÚ_Tc                  ó@   • \ rS rSrSr\SS j5       r\SS j5       rSrg)	Ú_Dependencyé   z5A class representing a (doubly-ended) queue of items.c                ó.   •  U S   $ ! [          a     gf = f)zHead of the dependency.r   N)Ú
IndexError©Úselfs    ÚV/home/mande/repo/quber/.venv/lib/python3.13/site-packages/griffe/_internal/c3linear.pyÚheadÚ_Dependency.head   s"   € ð	Ø˜‘7ˆNøÜó 	Ùð	ús   ‚ ‡
“c                ó€   •  [        U SU R                  5       5      $ ! [        [        4 a    [        / SS5      s $ f = f)zgTail of the dependency.

The `islice` object is sufficient for iteration or testing membership (`in`).
é   r   )r   Ú__len__Ú
ValueErrorr   r   s    r   ÚtailÚ_Dependency.tail   s?   € ð	$Ü˜$  4§<¡<£>Ó2Ð2øÜœJÐ'ó 	$Ü˜"˜a Ó#Ò#ð	$ús   ‚ �=¼=© N)Úreturnú	_T | None)r   r   )	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Úpropertyr   r   Ú__static_attributes__r   ó    r   r	   r	      s+   † Ù?àóó ðð ó$ó ó$r"   r	   c                  ó†   • \ rS rSrSrSS jrSS jrSS jrSS jr\	SS j5       r
\	SS j5       r\	SS	 j5       rSS
 jrSrg)Ú_DependencyListé(   zÙA class representing a list of linearizations (dependencies).

The last element of DependencyList is a list of parents.
It's needed  to the merge process preserves the local
precedence order of direct parent classes.
c                óP   • U Vs/ s H  n[        U5      PM     snU l        gs  snf )z>Initialize the list.

Parameters:
    *lists: Lists of items.
N)r	   Ú_lists)r   ÚlistsÚlsts      r   Ú__init__Ú_DependencyList.__init__0   s"   € ñ 49Ó9²5¨C”{ 3Ö'±5Ñ9ˆ�ùÒ9s   …#c                óB   ^• [        U4S jU R                   5       5      $ )z9Return True if any linearization's tail contains an item.c              3  óB   >#   • U  H  nTUR                   ;   v •  M     g 7f©N)r   )Ú.0r)   Úitems     €r   Ú	<genexpr>Ú/_DependencyList.__contains__.<locals>.<genexpr>:   s   øé € Ð;ª{¨�4˜3Ÿ8™8Ö#ª{ùs   ƒ)Úanyr'   )r   r0   s    `r   Ú__contains__Ú_DependencyList.__contains__8   s   ø€ äÔ;¨t¯{ª{Ó;Ó;Ð;r"   c                óH   • [        U R                  5      nU(       a  US-
  $ S$ )Nr   r   )Úlenr'   )r   Úsizes     r   r   Ú_DependencyList.__len__<   s!   € Ü�4—;‘;ÓˆÞ!��q‘Ð( qÐ(r"   c                ó6   • U R                   R                  5       $ r.   )r'   Ú__repr__r   s    r   r;   Ú_DependencyList.__repr__@   s   € Ø�{‰{×#Ñ#Ó%Ð%r"   c                óX   • U R                    Vs/ s H  oR                  PM     sn$ s  snf )zReturn the heads.)r'   r   )r   r)   s     r   ÚheadsÚ_DependencyList.headsC   s"   € ð %)§K¢KÓ0¢K˜S—”¡KÑ0Ð0ùÒ0s   �'c                ó   • U $ )z3Return self so that `__contains__` could be called.r   r   s    r   ÚtailsÚ_DependencyList.tailsH   s	   € ð ˆr"   c                ó:   • [        S U R                   5       5      $ )z0True if all elements of the lists are exhausted.c              3  ó>   #   • U  H  n[        U5      S :H  v •  M     g7f)r   N)r7   )r/   Úxs     r   r1   Ú,_DependencyList.exhausted.<locals>.<genexpr>P   s   é € Ð4ª 1”3�q“6˜Q–;ªùs   ‚)Úallr'   r   s    r   Ú	exhaustedÚ_DependencyList.exhaustedM   s   € ô Ñ4¨¯ªÓ4Ó4Ð4r"   c                ó€   • U R                    H.  nU(       d  M  UR                  U:X  d  M  UR                  5         M0     g)zŠRemove an item from the lists.

Once an item removed from heads, the leftmost elements of the tails
get promoted to become the new heads.
N)r'   r   Úpopleft)r   r0   Úis      r   ÚremoveÚ_DependencyList.removeR   s*   € ð —”ˆAßˆq�Q—V‘V˜t•^Ø—	‘	–ò r"   )r'   N)r(   úlist[_T | None]r   ÚNone)r0   r   r   Úbool)r   Úint)r   Ústr)r   rO   )r   r$   )r   rQ   )r0   r   r   rP   )r   r   r   r   r   r*   r4   r   r;   r    r>   rA   rH   rM   r!   r   r"   r   r$   r$   (   s\   † ñô:ô<ô)ô&ð ó1ó ð1ð óó ðð ó5ó ð5÷r"   r$   c                 óö   • / n[        U 6 n UR                  (       a  U$ UR                   H?  nU(       d  M  X2R                  ;  d  M  UR	                  U5        UR                  U5          O   [        S5      eMo  )z–Merge lists of lists in the order defined by the C3Linear algorithm.

Parameters:
    *lists: Lists of items.

Returns:
    The merged list of items.
zCannot compute C3 linearization)r$   rH   r>   rA   ÚappendrM   r   )r(   ÚresultÚlinearizationsr   s       r   Úc3linear_mergerX   ]   sv   € ð €FÜ$ eÐ,€Nà
Ø×#×#ØˆMà"×(Ô(ˆDßˆt˜×%9Ñ%9Õ9Ø—‘˜dÔ#Ø×%Ñ% dÔ+ñ ñ )ô Ð>Ó?Ð?ñ r"   N)r(   úlist[_T]r   rY   )Ú
__future__r   Úcollectionsr   Ú	itertoolsr   Útypingr   r   r	   r$   rX   r   r"   r   Ú<module>r^      s=   ðõ #å Ý Ý áˆTƒ]€ô$�%˜‘)ô $÷.2ñ 2õj@r"   