Skip to content

Hacky workaround for forward references #5

@lidatong

Description

@lidatong

Currently dataclasses's fields helper function returns a type object that is a str when fields are forward references rather than an actual typing object (I imagine it's due to the chicken-and-egg problem, but they might use better methods in the future to resolve the infinite expansion, e.g make it lazy).

I'm planning to put in a hacky workaround to do str comparisons against the type names to handle forward references (given there's only a finite, small set of json types).

If you think you might have a better solution, feel free to respond to this issue / submit a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem right

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions