-
Notifications
You must be signed in to change notification settings - Fork 10
Unions and recursive type hints #89
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
Comments
In the context of serialization, unions must carry additional information to be able to differentiate between the union variant being used, either implicitly via type I think it is error prone to rely on implicit type checks, so I think the first design decision would be if desert should extend into explicit union selectors. The downside of adding union selector fields is that the serialized stream adds information; There will be more fields than what the data class or schema suggests. |
I think that's #36? It kind of got put on hold while I did some CI stuff for desert and now I'm trying to catchup pyqt5-tools... I did get a wrapper approach implemented as |
Yeah let's call this a duplicate of #36. |
And #88 for the recursion piece mentioned here, I think. |
There are at least two issues going on with our handling of recursive types.
One is handling of forward references in type hints. Python's representation inside the
typing
module seems to be evolving, and the tools for dealing with them (typing_inspect and pytypes) may be still catching up. I think that's what's catching us in #88.There is also a general issue about the robustness of our union fields.
The text was updated successfully, but these errors were encountered: