
     f                    ^   d dl mZ d dlZd dlZd dlmZ d dlmZ d dlm	Z	m
Z
mZ d dlZe	rd dlmZ d dlmZ  ed          Z ed	          Z G d
 de          Zd-dZd.dZdddd/dZdddd0d!Zd1d%Z ej        d&           G d' d(                      Z G d) d*e          Zd2d,ZdS )3    )annotationsN)wraps)
ModuleType)TYPE_CHECKINGClassVarTypeVar)Callable)	ParamSpecArgsTRetTc                      e Zd ZdZdS )TrioDeprecationWarninga  Warning emitted if you use deprecated Trio functionality.

    As a young project, Trio is currently quite aggressive about deprecating
    and/or removing functionality that we realize was a bad idea. If you use
    Trio, you should subscribe to `issue #1
    <https://github.com/python-trio/trio/issues/1>`__ to get information about
    upcoming deprecations and other backwards compatibility breaking changes.

    Despite the name, this class currently inherits from
    :class:`FutureWarning`, not :class:`DeprecationWarning`, because while
    we're in young-and-aggressive mode we want these warnings to be visible by
    default. You can hide them by installing a filter or with the ``-W``
    switch: see the :mod:`warnings` documentation for details.

    N)__name__
__module____qualname____doc__     R/var/www/api.educacionweb.es/myenv/lib/python3.11/site-packages/trio/_deprecate.pyr   r      s           r   r   issueintreturnstrc                    d|  S )Nz+https://github.com/python-trio/trio/issues/r   )r   s    r   _url_for_issuer   ,   s    @@@@r   thingobjectc                    t          | d          r!t          | d          r| j         d| j         S t          |           S )Nr   r   .)hasattrr   r   r   )r   s    r   
_stringifyr!   0   sK    ul## :~(F(F :"99U%7999u::r      F)
stackleveluse_triodeprecationwarningversion
int | Noneinsteadr#   r$   boolNonec                  |dz  }t          |            d| }||dz  }n|dt          |           dz  }||dt          |           dz  }|rt          }nt          }t	          j         ||          |           d S )	N   z is deprecated since Trio z with no replacementz; use z insteadz ())r#   )r!   r   r   DeprecationWarningwarningswarn)r   r%   r   r'   r#   r$   msgwarning_classs           r   warn_deprecatedr2   6   s     !OJ
C
C'
C
CC%%5
7++5555,N5)),,,,! +'=*M--$$<<<<<<r   )r   r$   8Callable[[Callable[ArgsT, RetT]], Callable[ArgsT, RetT]]c               $     d fd}|S )NfnCallable[ArgsT, RetT]r   c                0    t                     d fd            }||j        h|j        }|                                }|dz  }|d	 d
z  }|dt                     dz  }|d dt	                     dz  }|d
z  }||_        |S )Nargs
ArgsT.argskwargsArgsT.kwargsr   r   c                 <    t                      | i |S )N)r'   r   r$   )r2   )r8   r:   r5   r'   r   r   r$   r%   s     r   wrapperz,deprecated.<locals>.do_wrap.<locals>.wrapper[   s@    +E    2t&v&&&r   z

z.. deprecated:: 
z   Use z
 instead.
z   For details, see `issue #z <z>`__.
r8   r9   r:   r;   r   r   )r   r   rstripr!   r   )r5   r=   docr'   r   r   r$   r%   s   `  r   do_wrapzdeprecated.<locals>.do_wrapX   s     
r	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 
	' =E?&/C**,,C6MC1g1111C"AG!4!4AAAA ]e]]~e?T?T]]]]4KC!GOr   )r5   r6   r   r6   r   )r%   r   r   r'   r$   rB   s   ````` r   
deprecatedrC   P   sA                       D Nr   old_qualnamenew_fnr6   c                   t          ||          t          d          dfd
                        }| |_        |                     d          d         |_        |S )Nr   r'   )r   __annotations__)assignedr8   r9   r:   r;   r   r   c                      | i |S )zDeprecated alias.r   )r8   r:   rE   s     r   r=   z!deprecated_alias.<locals>.wrapper   s     vt&v&&&r   r   r?   )rC   r   r   
rpartitionr   )rD   rE   r%   r   r=   s    `   r   deprecated_aliasrM   }   s     uf555
6=>>>' ' ' ' ' ?> 65' (G#..s33B7GNr   )slotsc                  Z    e Zd ZU  e            Zded<   ded<   ded<   ded<   eZded	<   d
S )DeprecatedAttributezClassVar[object]_not_setr   valuer   r%   r&   r   r'   N)r   r   r   r   rQ   rH   r'   r   r   r   rP   rP      sX         !'H))))MMMLLLGr   rP   c                  "    e Zd ZU ded<   d	dZdS )
_ModuleWithDeprecationszdict[str, DeprecatedAttribute]__deprecated_attributes__namer   r   r   c                   || j         v rY| j         |         }|j        }|t          j        u r|j        }| j         d| }t          ||j        |j        |           |j        S d}t          |
                    | j        |                    )Nr   rG   z!module '{}' has no attribute '{}')rU   r'   rP   rQ   rR   r   r2   r%   r   AttributeErrorformat)selfrV   infor'   r   r0   s         r   __getattr__z#_ModuleWithDeprecations.__getattr__   s    41111$7DlG-666*}--t--EE4<tz7SSSS:1SZZt<<===r   N)rV   r   r   r   )r   r   r   rH   r\   r   r   r   rT   rT      s6         ====> > > > > >r   rT   module_namec                ~    t           j        |          }t          |_        t	          |t                    sJ i |_        d S )N)sysmodulesrT   	__class__
isinstancerU   )r]   modules     r   enable_attribute_deprecationsrd      s=    [%F.Ff566666 (*F$$$r   )r   r   r   r   )r   r   r   r   )r   r   r%   r   r   r&   r'   r   r#   r   r$   r(   r   r)   )r%   r   r   r   r   r&   r'   r   r$   r(   r   r3   )
rD   r   rE   r6   r%   r   r   r&   r   r6   )r]   r   r   r)   )
__future__r   r_   r.   	functoolsr   typesr   typingr   r   r   attrscollections.abcr	   typing_extensionsr
   r   r   FutureWarningr   r   r!   r2   rC   rM   frozenrP   rT   rd   r   r   r   <module>rn      s   " " " " " " 



              3 3 3 3 3 3 3 3 3 3  ((((((++++++IgEwv    ]   $A A A A    ',= = = = = =:  (-* * * * * *Z   $ E       > > > > >j > > >"* * * * * *r   