<!-- Release notes generated using configuration in .github/release.yml at main -->
What's Changed
Breaking changes
* pyserde is powered by beartype by yukinarit in https://github.com/yukinarit/pyserde/pull/476
pyserde's strict type check system is overhauled by using [beartype](https://github.com/beartype/beartype) - O(1) runtime type checker. all pyserde classes now implicitly implement `beartype` decorator by default. Passing wrong type of values in constructor raises beartype's validation error.
python
serde
class Foo:
s: str
If you call `Foo` with wrong type of object, beartype validation error is raised.
python
>>> foo = Foo(10)
beartype.roar.BeartypeCallHintParamViolation: Method __main__.Foo.__init__()
parameter s=10 violates type hint <class 'str'>, as int 10 not instance of str.
If you deserialize with wrong value, serde error is raised.
python
>>> print(from_json(Foo, '{"s": 10}'))
serde.compat.SerdeError: Method __main__.Foo.__init__()
parameter s=10 violates type hint <class 'str'>, as int 10 not instance of str.
If you want to disable type check, set either `serde.disabled` or `serde.coerce` in `type_check` class attribute.
python
from serde import serde, disabled
serde(type_check=disabled)
class Foo:
s: str
See https://yukinarit.github.io/pyserde/guide/en/type-check.html for more information.
**Full Changelog**: https://github.com/yukinarit/pyserde/compare/v0.13.2...v0.14.0