o
    è¯ªgQ  ã                   @   sF   d Z ddlmZ ddlmZ dd„ Zdd„ Zdd	„ Zd
d„ Ze	ƒ Z
dS )z%
Commonly used hooks for on_setattr.
é   )Ú_config©ÚFrozenAttributeErrorc                     s   ‡ fdd„}|S )zf
    Run all *setters* and return the return value of the last one.

    .. versionadded:: 20.1.0
    c                    s   |}ˆ D ]}|| ||ƒ}q|S )N© )ÚinstanceÚattribÚ	new_valueÚrvÚsetter©Úsettersr   úH/var/www/html/chatdoc2/venv/lib/python3.10/site-packages/attr/setters.pyÚwrapped_pipe   s   zpipe.<locals>.wrapped_piper   )r   r   r   r   r   Úpipe   s   r   c                 C   s   t ‚)zL
    Prevent an attribute to be modified.

    .. versionadded:: 20.1.0
    r   )Ú_Ú__Ú___r   r   r   Úfrozen   s   r   c                 C   s,   t jdu r|S |j}|s|S || ||ƒ |S )z^
    Run *attrib*'s validator on *new_value* if it has one.

    .. versionadded:: 20.1.0
    F)r   Ú_run_validatorsÚ	validator)r   r   r   Úvr   r   r   Úvalidate&   s   
r   c                 C   s8   |j }|rddlm} t||ƒs||ƒS ||| |ƒS |S )z~
    Run *attrib*'s converter -- if it has one -- on *new_value* and return the
    result.

    .. versionadded:: 20.1.0
    r   )Ú	Converter)Ú	converterÚ_maker   Ú
isinstance)r   r   r   Úcr   r   r   r   Úconvert8   s   
r   N)Ú__doc__Ú r   Ú
exceptionsr   r   r   r   r   ÚobjectÚNO_OPr   r   r   r   Ú<module>   s   	
