Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_replace_refs should use mapping and sequence type information from inbound object #67

Open
bdanofsky opened this issue Feb 1, 2024 · 0 comments

Comments

@bdanofsky
Copy link

I would like to defer some steps, e.g. deserialization of a complex object, until object access time.
This could be accomplished by setting json.load(*, cls=) and returning a collection that defers the object deserialization until a later point.
Unfortunately _replace_refs assumes all mapping types are Dicts and thus the type of the inbound Mapping object is lost.
This could be easily overcome by changing the building of the mapping
obj.class(**{.....})
this would preserve the inbound type that comes from json.load.
The same could be applied to Sequence types.

Obviously this does not apply to the replacement of the referent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant