I get the following traceback that mypy throws:

dust/core/validator/_validators.py:504: error: Unsupported operand types for < ("str" and "ValidateProperty")
dust/core/validator/_validators.py:504: error: Unsupported operand types for < ("float" and "ValidateProperty")
dust/core/validator/_validators.py:504: error: Unsupported operand types for < ("float" and "str")
dust/core/validator/_validators.py:504: error: Unsupported operand types for < ("str" and "float")

for the code that goes something like following.

class Value(ValidateProperty):
    def __init__(min_value: VALUE_RANGE=None, max_value: VALUE_RANGE=None):
        if min_value is not None and max_value is not None:
            if max_value < min_value:
                raise ValueError(f"max_value can not be less than min_value")

where VALUE_RANGE is

VALUE_RANGE = typing.Union[FLOAT,STRING, None]

such that:

FLOAT = typing.Union[float, "ValidateProperty", None]
STRING = typing.Union[str, "ValidateProperty", None]

and ValidateProperty is an ABC class with __get__ and __set__ methods.

how to ensure that mypy gets that comapred values are always of same types ?

0

There are 0 answers