Skip to content

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

@bdanofsky

Description

@bdanofsky

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions