You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from_dict does not fail when parsing a boolean for an integer field. I would expect the following code to fail. Instead it parses a dataclass where the field a is an bool instead of a int.
Hi @mcobzarenco
Thanks for being interested in pyserde!
pyserde relies on beartype for type checking and unfortunately this is the default behavior of beartype. But yeah, you're right, I believe this is not a bug in beartype because python's bool is a subclass of int.
from_dict
does not fail when parsing a boolean for an integer field. I would expect the following code to fail. Instead it parses a dataclass where the fielda
is anbool
instead of aint
.PS awesome library btw, I've long wanted something like
serde-rs
in Python 🙌EDIT: booleans in Python are implemented as a subclass of integers, so actually this may be expected behaviour
The text was updated successfully, but these errors were encountered: