Repository navigation
docs(corekit): say which generated registries bound their width (#2178) - #2192
Merged
Merged
Conversation
The Notes of EnumField.post_process, and a docstring in tests/corekit/test_fields_numbers_unassigned_enum.py, said only the bit-flag registries bound themselves to a width and that none of those backs a plain EnumField. Most generated _missing_ guards range-check the value, plain registries such as ipv4 OptionNumber included, and those are plain EnumField namespaces. Say so, and that it is harmless because the out-of-width rejection is the bare ValueError the method falls back on. Docstrings only: the docstring-stripped AST of both files is unchanged.
Owner
Author
|
Review: GOOD TO GO at |
Owner
Author
|
Ready to merge at
|
Contributor
|
Coverage: 91.55% (unit tier, Python 3.15,
Per-file detail: the |
5 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
docs— documentation onlyDescription
Closes #2178.
EnumField.post_process's Notes said only the bit-flag registries bound their width, and that none backs a plainEnumField. In fact most generated_missing_guards range-check the value. Plain registries such asipv4.option_number.OptionNumberback plainEnumFields in the IPv4 schema.ValueErrorthe method already falls back on. The same false claim intest_an_in_library_rejection_is_not_absorbed's docstring is corrected to match.main.OptionNumber(300)raises a plainValueError, and a two-byteEnumFieldover it resolves 300 to the unassigned pseudo-member.