
    g`                        % S r SSKJr  SSKrSSKrSSKJr  SSKrSSKJ	r	  \R                  (       a  SrS\S	'   S
rS\S'    " S S\5      r " S S5      rSS jrg)z:Tools to provide pretty/human-readable display of objects.    )annotationsN)Any   )_typing_extraz'typing.Iterable[tuple[str | None, Any]]ztyping_extensions.TypeAliasReprArgszJtyping.Iterable[Any | tuple[Any] | tuple[str, Any] | tuple[str, Any, Any]]RichReprResultc                  "    \ rS rSrSrSS jrSrg)	PlainRepr   zString class where repr doesn't include quotes. Useful with Representation when you want to return a string
representation of something that is valid (or pseudo-valid) python.
c                    [        U 5      $ N)strselfs    Q/home/matz/Project1/venv/lib/python3.13/site-packages/pydantic/_internal/_repr.py__repr__PlainRepr.__repr__   s    4y     Nreturnr   )__name__
__module____qualname____firstlineno____doc__r   __static_attributes__r   r   r   r
   r
      s    r   r
   c                  h    \ 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r	SS jr
SS	 jrSS
 jrSrg)Representation   r   c                
  ^  T R                   nU(       d+  [        T S5      (       a  T R                  R                  5       nU 4S jU 5       nU VVs/ s H#  u  p4Uc  M
  X4T La  UOT R	                  U5      4PM%     snn$ s  snnf )a  Returns the attributes to show in __str__, __repr__, and __pretty__ this is generally overridden.

Can either return:
* name - value pairs, e.g.: `[('foo_name', 'foo'), ('bar_name', ['b', 'a', 'r'])]`
* or, just values, e.g.: `[(None, 'foo'), (None, ['b', 'a', 'r'])]`
__dict__c              3  >   >#    U  H  o[        TU5      4v   M     g 7fr   )getattr).0sr   s     r   	<genexpr>/Representation.__repr_args__.<locals>.<genexpr>0   s     <1WT1%&s   )	__slots__hasattrr"   keys__repr_recursion__)r   attrs_namesattrsavs   `    r   __repr_args__Representation.__repr_args__&   sq     nnwtZ88--,,.K<<TYkTYDA]^G$AD,C,CA,FGTYkkks   	A?A?c                .    U R                   R                  $ )z/Name of the instance's class, used in __repr__.)	__class__r   r   s    r   __repr_name__Representation.__repr_name__3   s    ~~&&&r   c                L    S[        U5      R                   S[        U5       S3$ )z8Returns the string representation of a recursive object.z<Recursion on z	 with id=>)typer   id)r   objects     r   r,   !Representation.__repr_recursion__7   s(      V 5 56i6
|1MMr   c                N    UR                  S U R                  5        5       5      $ )Nc              3  R   #    U  H  u  pUc  [        U5      OU SU< 3v   M     g 7f)N=)repr)r%   r/   r0   s      r   r'   .Representation.__repr_str__.<locals>.<genexpr>=   s+     ePd	T!W!AaU|CPds   %')joinr1   )r   join_strs     r   __repr_str__Representation.__repr_str__<   s!    }}ePTPbPbPdeeer   c              +     #    U R                  5       S-   v   Sv   U R                  5        H!  u  p4Ub  US-   v   U" U5      v   Sv   Sv   M#     Sv   Sv   g7f)	zRUsed by devtools (https://python-devtools.helpmanual.io/) to pretty print objects.(r   Nr?   ,r   ))r5   r1   )r   fmtkwargsnamevalues        r   
__pretty__Representation.__pretty__?   sc       "S((--/KDSj e*IG 0 	s   AAc              #  Z   #    U R                  5        H  u  pUc  Uv   M  X4v   M     g7f)zYUsed by Rich (https://rich.readthedocs.io/en/stable/pretty.html) to pretty print objects.N)r1   )r   rM   
field_reprs      r   __rich_repr__Representation.__rich_repr__L   s/      $ 2 2 4D|  &&	 !5s   )+c                $    U R                  S5      $ )N )rD   r   s    r   __str__Representation.__str__T   s      %%r   c                L    U R                  5        SU R                  S5       S3$ )NrG   , rJ   )r5   rD   r   s    r   r   Representation.__repr__W   s+    $$&'q):):4)@(ACCr   N)r   r   r   )r;   r   r   r   )rC   r   r   r   )rK   ztyping.Callable[[Any], Any]rL   r   r   z!typing.Generator[Any, None, None])r   r   )r   r   r   r   r)   r1   r5   r,   rD   rO   rS   rW   r   r   r   r   r   r   r      s5     Il'N
f'&Dr   r   c                   [        U [        R                  [        R                  45      (       a  U R                  $ U SL a  g[        U [
        5      (       a  [        U 5      $ [        U [        R                  5      (       d  [        R                  " U 5      (       a  [        U 5      $ [        U [        R                  [        R                  [        45      (       d  U R                  n [        R                   " ["        R$                  " U 5      5      (       a9  SR'                  [)        [*        ["        R,                  " U 5      5      5      nSU S3$ [        U [        R                  5      (       a  [        R.                  " U 5      (       a4  SR'                  [)        [        ["        R,                  " U 5      5      5      nO3SR'                  [)        [*        ["        R,                  " U 5      5      5      n U R0                   SU S3$ [        U [        5      (       a  U R0                  $ [        U 5      R5                  SS5      R5                  S	S5      $ ! [2         a.    [        U 5      R5                  SS5      R5                  S	S5      s $ f = f)
zPretty representation of a type, should be as close as possible to the original type definition string.

Takes some logic from `typing._type_repr`.
.z...rZ   zUnion[][ztyping. ztyping_extensions.)
isinstancetypesFunctionTypeBuiltinFunctionTyper   r   r@   typing
ForwardRefr   is_type_alias_typer   typing_baseWithArgsTypesr9   r4   origin_is_uniontyping_extensions
get_originrB   mapdisplay_as_typeget_args
is_literalr   AttributeErrorreplace)objargss     r   rm   rm   [   s   
 #**E,E,EFGG||		C	(	(Cy	C**	+	+}/O/OPS/T/T3xcM55}7R7RTXYZZmm$$%6%A%A#%FGGyy_.?.H.H.MNOvQ	C44	5	5##C((99S'8'A'A#'FGHD99S2C2L2LS2QRSD	U&&'qa00 
C		Cy  B/778LbQQ  	Us8##Ir2::;OQSTT	Us   1I 5JJ)rr   r   r   r   )r   
__future__r   _annotationsra   rd   r   rj   r_   r   TYPE_CHECKINGr   __annotations__r   r   r
   r   rm   r   r   r   <module>rx      s]    @ 2     	,UH)UT / 
 ;D ;D| Rr   