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

Add one-of match example to README #558

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

MicaelJarniac
Copy link
Contributor

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

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 danielgtaylor#510 and danielgtaylor#358.
@MicaelJarniac
Copy link
Contributor Author

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

@Gobot1234 Gobot1234 merged commit dbd3192 into danielgtaylor:master Mar 19, 2024
22 checks passed
@Gobot1234
Copy link
Collaborator

Thanks!

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.

3 participants