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

We're missing a lot of useful and sensible support for oneof fields #4

Open
CCP-Zeulix opened this issue Jun 19, 2024 · 0 comments
Open

Comments

@CCP-Zeulix
Copy link
Contributor

There are some cool features generated in the pb2 classes like "HasField()" and "WhichOneof()" to check which "oneof" field was/is used in the messages. The dc classes should really have something similar.

The pb2 classes also do stuff like clear all other fields in a "oneof" group when setting one fields. I'm not sure what would happen in Protoplasm in this case since we're going Dataclass -> dict -> PB2 Class so not really setting one field at a time. I'm guessing this will either raise an exception (preferred) or if there are internal loops that just iterate over the dict and set one field at a time, then which oneof field will be retained simply will be the "last" one iterated over, which will be very arbitrary in each case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant