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
You can create a forked JsonSerializable and attach attr_getters to this fork with a single .with_load() call, and then register deserializers. But those deserializers are ignored when using .from_json() on the subclass.
You can create a forked
JsonSerializable
and attachattr_getters
to this fork with a single.with_load()
call, and then register deserializers. But those deserializers are ignored when using.from_json()
on the subclass.Demo:
The above demo leads to a traceback:
because the replacement implementation for
.load()
generated bywith_load()
does not pass in the forked instance:jsons/jsons/classes/json_serializable.py
Lines 91 to 95 in 03b5ff9
like the original
.load()
implementation does:jsons/jsons/classes/json_serializable.py
Lines 134 to 143 in 03b5ff9
We can work around this by creating a fork first, then using
forked.with_default(..., fork_inst=forked)
, but is less than ideal.The text was updated successfully, but these errors were encountered: