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__/between.cpython-311.pyc
�

�;f�	���dZddlmZddlmZmZddlmZmZddlm	Z	ede
eeed��Z
e	ddd	�d
e
dee
edfdee
edffd
���ZdS)zBetween.�)�datetime)�TypeVar�Union�)�AbsMax�AbsMin)�	validator�PossibleValueTypesN)�min_val�max_val�valuerrc���|�dS|�t��}|�t��}	||krtd���n"#t$r}td��|�d}~wwxYw||cxko|kncS)a:Validate that a number is between minimum and/or maximum value.

    This will work with any comparable type, such as floats, decimals and dates
    not just integers. This validator is originally based on [WTForms-NumberRange-Validator][1].

    [1]: https://github.com/wtforms/wtforms/blob/master/src/wtforms/validators.py#L166-L220

    Examples:
        >>> from datetime import datetime
        >>> between(5, min_val=2)
        # Output: True
        >>> between(13.2, min_val=13, max_val=14)
        # Output: True
        >>> between(500, max_val=400)
        # Output: ValidationError(func=between, args=...)
        >>> between(
        ...     datetime(2000, 11, 11),
        ...     min_val=datetime(1999, 11, 11)
        ... )
        # Output: True

    Args:
        value:
            Value which is to be compared.
        min_val:
            The minimum required value of the number.
            If not provided, minimum value will not be checked.
        max_val:
            The maximum value of the number.
            If not provided, maximum value will not be checked.

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

    Raises:
        (ValueError): If `min_val` is greater than `max_val`.
        (TypeError): If there's a type mismatch during comparison.

    Note:
        - `PossibleValueTypes` = `TypeVar("PossibleValueTypes", int, float, str, datetime)`
        - If neither `min_val` nor `max_val` is provided, result will always be `True`.
    NFz*`min_val` cannot be greater than `max_val`zComparison type mismatch)rr�
ValueError�	TypeError)r
rr�errs    �E/opt/alt/python311/lib/python3.11/site-packages/validators/between.py�betweenrs���f
�}��u����(�(�����(�(��=��W����I�J�J�J����=�=�=��2�3�3��<�����=�����e�&�&�&�&�w�&�&�&�&�&s�<�
A�A�A)�__doc__r�typingrr�	_extremesrr�utilsr	�int�float�strr
r��r�<module>rs�����������!�!�!�!�!�!�!�!�&�%�%�%�%�%�%�%��������W�1�3��s�H�d�S�S���
8<�7;�@'�@'�@'��@'��%�v�t�3�
4�	@'�
�%�v�t�3�
4�@'�@'�@'���@'�@'�@'r