Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/attr/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/attr/__pycache__/converters.cpython-310.pyc
o

��`��@sndZddlmZmZmZddlmZddlmZm	Z	m
Z
es&ddlZddlZgd�Z
dd	�Zedfd
d�ZdS)z
Commonly useful converters.
�)�absolute_import�division�print_function�)�PY2)�NOTHING�Factory�pipeN)r	�optional�default_if_nonec	s��fdd�}tsLd}zt���}WnttfyYnw|rLt|j���}|r<|djtj	j
ur<tj|dj|j
d<|jtjj
urLtj|j|j
d<|S)aO
    A converter that allows an attribute to be optional. An optional attribute
    is one which can be set to ``None``.

    Type annotations will be inferred from the wrapped converter's, if it
    has any.

    :param callable converter: the converter that is used for non-``None``
        values.

    .. versionadded:: 17.1.0
    cs|durdS�|�S�N���val��	converterr
�1/usr/lib/python3/dist-packages/attr/converters.py�optional_converter%sz$optional.<locals>.optional_converterNrr�return)r�inspect�	signature�
ValueError�	TypeError�list�
parameters�values�
annotation�	Parameter�empty�typing�Optional�__annotations__�return_annotation�	Signature)rr�sig�paramsr
rrr
s&�
�
�r
csx�tur|durtd���tur|durtd��|dur t|��t�t�r4�jr,td���fdd�}|S�fdd�}|S)a�
    A converter that allows to replace ``None`` values by *default* or the
    result of *factory*.

    :param default: Value to be used if ``None`` is passed. Passing an instance
       of `attr.Factory` is supported, however the ``takes_self`` option
       is *not*.
    :param callable factory: A callable that takes no parameters whose result
       is used if ``None`` is passed.

    :raises TypeError: If **neither** *default* or *factory* is passed.
    :raises TypeError: If **both** *default* and *factory* are passed.
    :raises ValueError: If an instance of `attr.Factory` is passed with
       ``takes_self=True``.

    .. versionadded:: 18.2.0
    Nz(Must pass either `default` or `factory`.z5Must pass either `default` or `factory` but not both.z1`takes_self` is not supported by default_if_none.cs|dur|S���Sr)�factoryr��defaultr
r�default_if_none_converterasz2default_if_none.<locals>.default_if_none_convertercs|dur|S�Srr
rr'r
rr)is)rrr�
isinstance�
takes_selfr)r(r&r)r
r'rr>s"�
��r)�__doc__�
__future__rrr�_compatr�_makerrr	rr�__all__r
rr
r
r
r�<module>s'

Spamworldpro Mini