HEX
Server: LiteSpeed
System: Linux us-phx-web1284.main-hosting.eu 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: u300739242 (300739242)
PHP: 8.2.30
Disabled: system, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/alt/python311/lib/python3.11/site-packages/validators/__pycache__/length.cpython-311.pyc
�

�;f��
�z�dZddlmZddlmZddlmZeddd�ded	eedfd
eedffd���ZdS)zLength.�)�Union�)�between)�	validatorN��min_val�max_val�valuerr	c��|�|dkrtd���|�|dkrtd���ttt|��||�����S)a�Return whether or not the length of given string is within a specified range.

    Examples:
        >>> length('something', min_val=2)
        # Output: True
        >>> length('something', min_val=9, max_val=9)
        # Output: True
        >>> length('something', max_val=5)
        # Output: ValidationError(func=length, ...)

    Args:
        value:
            The string to validate.
        min_val:
            The minimum required length of the string. If not provided,
            minimum length will not be checked.
        max_val:
            The maximum length of the string. If not provided,
            maximum length will not be checked.

    Returns:
        (Literal[True]): If `len(value)` is in between the given conditions.
        (ValidationError): If `len(value)` is not in between the given conditions.

    Raises:
        (ValueError): If either `min_val` or `max_val` is negative.
    Nrz7Length cannot be negative. `min_val` is less than zero.z7Length cannot be negative. `max_val` is less than zero.r)�
ValueError�boolr�len)r
rr	s   �D/opt/alt/python311/lib/python3.11/site-packages/validators/length.py�lengthrsa��:��w��{�{��R�S�S�S���w��{�{��R�S�S�S����E�
�
�G�W�E�E�E�F�F�F�)	�__doc__�typingrr�utilsr�str�intr�rr�<module>rs���
�
��������������������9=�[_�!G�!G�!G�#�!G�e�C��I�&6�!G��c�SW�i�HX�!G�!G�!G���!G�!G�!Gr