o
    MK&hZ	                  
   @   sx   d Z ddlZddlZddlmZmZ dededefddZdededed	eegef fd
dZdeded	efddZ	dS )a  Helper functions for deprecation.

This interface is itself unstable and may change without warning. Do
not use these functions yourself, even as a joke. The underscores are
there for a reason. No support will be given.

In particular, most of this will go away without warning once
Beautiful Soup drops support for Python 3.11, since Python 3.12
defines a `@typing.deprecated()
decorator. <https://peps.python.org/pep-0702/>`_
    N)AnyCallableold_namenew_nameversionc                    s>   t dtf fdd}|jdtddf fdd}|S )zWAlias one attribute name to another for backward compatibility

    :meta private:
    returnc                    s.   t jd d  d dtdd t|  S ):meta private:zAccess to deprecated property . (Replaced by ) -- Deprecated since version .   
stacklevelwarningswarnDeprecationWarninggetattr)selfr   r   r    C/var/www/html/venv/lib/python3.10/site-packages/bs4/_deprecation.pyalias   s   
z _deprecated_alias.<locals>.aliasvalueNc                    s0   t jd d  d dtdd t|  |S )r   zWrite to deprecated property r	   r
   r   r   r   )r   r   r   setattr)r   r   r   r   r   r   &   s   )propertyr   setterstrr   r   r   r   r   r   r   _deprecated_alias   s
   		r   r   c                    s"   dt dt dt f fdd}|S )Nargskwargsr   c                    s8   t jd d  d dtdd t|  |i |S r   zCall to deprecated method r	   r
   r   r   r   r   )r   r    r!   r   r   r   r   6   s   z)_deprecated_function_alias.<locals>.alias)r   r   r   r   r   _deprecated_function_alias3   s   	r#   replaced_byc                    s   dt dt f fdd}|S )Nfuncr   c                    s,   t  dtdtdtf fdd}|S )Nr    r!   r   c                     s4   t jd j d d dtdd  | i |S r"   )r   r   __name__r   )r    r!   )r%   r$   r   r   r   with_warningD   s   z4_deprecated.<locals>.deprecate.<locals>.with_warning)	functoolswrapsr   )r%   r'   r$   r   )r%   r   	deprecateC   s    	z_deprecated.<locals>.deprecate)r   )r$   r   r+   r   r*   r   _deprecatedB   s   r,   )
__doc__r(   r   typingr   r   r   r   r#   r,   r   r   r   r   <module>   s    
