Skip to content

Releases: hashberg-io/typing-validation

v1.2.11

17 Mar 12:43
Compare
Choose a tag to compare

v1.2.10

21 Feb 18:00
Compare
Choose a tag to compare

Introduced partial support for validation against Type[T] (see #18 for limitations of the current implementation).

v1.2.9

20 Feb 21:30
Compare
Choose a tag to compare

Introduce support for TypeVar.

v1.2.8

30 Jan 16:34
Compare
Choose a tag to compare

Full Changelog: v1.2.7...v1.2.8

v1.2.7

30 Jan 13:15
Compare
Choose a tag to compare

Added support for NumPy dtype annotations in NDArray types.

v1.2.6

30 Jan 10:47
Compare
Choose a tag to compare

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

23 Jan 15:35
Compare
Choose a tag to compare

Full Changelog: v1.2.4...v1.2.5

v1.2.4

16 Jan 13:26
Compare
Choose a tag to compare

Full Changelog: v1.2.3...v1.2.4

v1.2.3

07 Jan 15:35
Compare
Choose a tag to compare

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

v1.2.2

07 Jan 13:29
Compare
Choose a tag to compare

Fixed several issues with the representation of TypeInspector objects and the reconstructor of the recorded_type. Fixed a bug of can_validate on special generic aliases (see issue #5).

Full Changelog: v1.2.1...v1.2.2