python-betterproto icon indicating copy to clipboard operation
python-betterproto copied to clipboard

Add one-of `match` example to README

Open MicaelJarniac opened this issue 1 year ago • 1 comments

Removed the parts of the example that showed accessing an unset value, as it now raises an AttributeError, and added an example of the match way of accessing the attributes.

Related to #510 and #358.

Summary

Update documentation related to one-of fields and using a match statement to read it.

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)
  • [x] This PR is not a code change (e.g. documentation, README, ...)

MicaelJarniac avatar Feb 22 '24 20:02 MicaelJarniac

@a-khabarov could you please review and make sure I have documented it correctly?

MicaelJarniac avatar Feb 22 '24 20:02 MicaelJarniac

Thanks!

Gobot1234 avatar Mar 19 '24 21:03 Gobot1234