Skip to content

Conversation

@benedikt-bartscher
Copy link
Contributor

@benedikt-bartscher benedikt-bartscher commented Nov 16, 2025

Summary

this kind of match statement worked fine with python-betterproto, it seems to be a regression/breaking change in python-betterproto2

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
    • This change has an associated test.
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)

@benedikt-bartscher
Copy link
Contributor Author

python-betterproto seems to raise AttributeError if you access oneof's which are not set which causes pythons pattern matching to check for the next case. This behavior has changed in python-betterproto2, where accessing unset oneof fields returns None. I guess this behavior is intended? We should probably add this change to a "breaking changes since betterproto1" list?

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

Successfully merging this pull request may close these issues.

1 participant