16 lines
321 B
Python
16 lines
321 B
Python
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass, field
|
|
|
|
|
|
@dataclass
|
|
class Validate:
|
|
"""Validate."""
|
|
|
|
errors: list[str] = field(default_factory=list)
|
|
|
|
@property
|
|
def success(self) -> bool:
|
|
"""Return bool if the validation was a success."""
|
|
return len(self.errors) == 0
|