value.py 220 B

12345678910111213
  1. # (c) Nelen & Schuurmans
  2. __all__ = ["Value"]
  3. class Value:
  4. @classmethod
  5. def __get_validators__(cls):
  6. yield cls.validate
  7. @classmethod
  8. def validate(cls, v):
  9. return cls(v) # type: ignore