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

[Enhancement] Add a Clear method to the Message class for compatibility. #511

Open
ABaumher opened this issue Jul 11, 2023 · 0 comments
Open
Labels
enhancement New feature or request low priority

Comments

@ABaumher
Copy link

When converting existing code to use this module over standard protobuf, one issue raised was the lack of ParseFromString. This has already been mentioned at #323, with a PR in the works at #336. However, this is blocked because it does not perform the same calls as the standard, namely, Clear. In my use of this module, i have worked around this issue by simply creating a new instance (which is always the default) instead of using an existing one, at which point just calling parse works fine.

Ideally, we'd need a clear function (preferably lowercase to match python syntax, but might want TitleCase for compatibility) on the abstract Message class and an implementation that resets all fields to their default values. We'd need to confirm that our implementation matches standard protobuf when it comes to user-defined default values.

to be clear, this isn't a bug, and it doesn't prevent the use of this module.
I'd look into addressing this myself but the logic used to set default values eludes me, at least at first glance.

@Gobot1234 Gobot1234 added enhancement New feature or request low priority labels Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request low priority
Projects
None yet
Development

No branches or pull requests

2 participants