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
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.
The text was updated successfully, but these errors were encountered:
Currently dataclasses's
fields
helper function returns a type object that is astr
when fields are forward references rather than an actualtyping
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.
The text was updated successfully, but these errors were encountered: