Releases: hashberg-io/typing-validation
Releases · hashberg-io/typing-validation
v1.2.11
v1.2.10
v1.2.9
v1.2.8
Full Changelog: v1.2.7...v1.2.8
v1.2.7
v1.2.6
Changed the return type of validate
from None
to Literal[True]
, so that validation calls can be gated behind assertions and compiled away in optimised scenarios:
from typing_validation import validate
assert validate(val, t) # this is compiled away with -O or -OO
Introduced a variant is_valid
of validate
which returns a bool
:
from typing_validation import is_valid
if is_valid(val, t):
... # do stuff
else:
... # handle error
In case of validation failure, failure information is made available using latest_validation_failure
:
from typing_validation import is_valid, latest_validation_failure
if is_valid(val, t):
... # do stuff
else:
cause = latest_validation_failure()
... # handle error
v1.2.5
Full Changelog: v1.2.4...v1.2.5
v1.2.4
Full Changelog: v1.2.3...v1.2.4
v1.2.3
Changes from v1.2.2
:
- Added support for user-defined generic classes.
- Added support for union types in v3.10+ style
Full Changelog: v1.2.2...v1.2.3