modmex 1.2.4__tar.gz → 1.2.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: modmex
3
- Version: 1.2.4
3
+ Version: 1.2.5
4
4
  Classifier: Programming Language :: Python :: 3.10
5
5
  Classifier: Programming Language :: Python :: 3.11
6
6
  Classifier: Programming Language :: Python :: 3.12
@@ -613,6 +613,9 @@ def _compile_constraints(field: dataclasses.Field[Any]) -> ConstraintValidators:
613
613
  return ()
614
614
 
615
615
  def validate_constraints(value: Any, loc: Loc) -> None:
616
+ # An optional field without a value has nothing to check: its type already allowed None.
617
+ if value is None:
618
+ return
616
619
  if gt is not None and not value > gt:
617
620
  raise _error(loc, f"must be > {gt}", "value_error.number.not_gt")
618
621
  if ge is not None and not value >= ge:
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "modmex"
3
- version = "1.2.4"
3
+ version = "1.2.5"
4
4
  description = "Lightweight Python models built on dataclasses with validation, serialization, and type-safe data mapping"
5
5
  authors = [
6
6
  {name = "clandro89@gmail.com"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes