ITADN

Treat `NoneType` fields as `None`/missing during deserialization of mappings

#79Opentamasfe 创建于 2024-12-10
T
tamasfecommented
MCVE: Rust side: ```rs #[derive(Deserialize)] struct Foo { #[serde(default)] foo: bool, } ``` python side: ```python foo = { "foo": None, } ``` `depythonize::<Foo>(...)` will fail with `unexpected type: 'NoneType' object cannot be converted to '...'`. However `{}` as input will work. As far as I've looked, a check might be missing around here: https://github.com/davidhewitt/pythonize/blob/4491cdb46f35ab3fc1b419beef92171fbef510da/src/de.rs#L450 If that's the case I can look into it open PR with the fix.
0 条评论