Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/validators/between.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ def between(
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.
(ValidationError): If `min_val` is greater than `max_val` or the values cannot be compared.

Note:
- `PossibleValueTypes` = `TypeVar("PossibleValueTypes", int, float, str, datetime, None)`
Expand Down
4 changes: 1 addition & 3 deletions src/validators/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ def domain(
Returns:
(Literal[True]): If `value` is a valid domain name.
(ValidationError): If `value` is an invalid domain name.

Raises:
(UnicodeError): If `value` cannot be encoded into `idna` or decoded into `utf-8`.
(ValidationError): If `value` cannot be encoded into `idna` or decoded into `utf-8`.
"""
if not value:
return False
Expand Down
4 changes: 1 addition & 3 deletions src/validators/length.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ def length(value: str, /, *, min_val: Union[int, None] = None, max_val: Union[in
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.
(ValidationError): If either `min_val` or `max_val` is negative.
"""
if min_val is not None and min_val < 0:
raise ValueError("Length cannot be negative. `min_val` is less than zero.")
Expand Down