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

Hacky workaround for forward references #5

Closed
lidatong opened this issue Aug 12, 2018 · 0 comments
Closed

Hacky workaround for forward references #5

lidatong opened this issue Aug 12, 2018 · 0 comments
Labels
invalid This doesn't seem right

Comments

@lidatong
Copy link
Owner

lidatong commented Aug 12, 2018

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.

@lidatong lidatong added the invalid This doesn't seem right label Aug 12, 2018
@lidatong lidatong changed the title Data Classes that contain forward references are not supported Hacky workaround for forward references Aug 12, 2018
@lidatong lidatong closed this as completed Nov 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant