Conversation
There was a problem hiding this comment.
Pull request overview
This PR renames "normative points" to "requirements" throughout the codebase and implements __copy__ and __deepcopy__ operators for Packtype definitions, along with various type hinting improvements.
- Renamed "normative points" terminology to "requirements" for better clarity
- Implemented
__copy__and__deepcopy__methods inNumericclass and updated tests to use Python's standardcopymodule - Fixed type hints for return types in several methods to properly use
SelfandNone
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/utils/test_utils_basic.py | Updated copy tests to use standard copy module; added comprehensive deepcopy tests for enum, struct, union, and array types |
| tests/pysyntax/test_struct.py | Added test for struct padding field functionality |
| tests/grammar/test_requirement.py | Renamed test functions and updated references from "normative"/"norm" to "requirement"/"req" |
| pyproject.toml | Bumped version from 3.1.0 to 3.1.1 |
| packtype/utils/basic.py | Simplified unpack function to use Numeric base class |
| packtype/types/requirement.py | Renamed NormativePoint class to RequirementTag and updated docstrings |
| packtype/types/primitive.py | Fixed return type hints for value setter and _pt_set method; added _pt_unpack classmethod |
| packtype/types/package.py | Updated all references from _PT_NORMS to _PT_REQUIREMENTS and renamed related methods |
| packtype/types/numeric.py | Added _pt_unpack, __copy__, and __deepcopy__ methods to Numeric class |
| packtype/types/enum.py | Fixed return type hint for _pt_cast and added _pt_unpack method |
| packtype/types/base.py | Removed __copy__ and __deepcopy__ methods that raised NotImplementedError |
| packtype/types/assembly.py | Fixed padding field implementation and type hint for _pt_unpack |
| packtype/types/array.py | Added __copy__ and __deepcopy__ methods for PackedArray |
| packtype/grammar/transformer.py | Renamed decl_normative to decl_requirement and updated imports |
| packtype/grammar/packtype.lark | Updated grammar from "vnorm" to "requirement" keyword and enhanced HEX regex to support underscore separators |
| packtype/grammar/grammar.py | Updated declaration handling from DeclNormative to DeclRequirement |
| packtype/grammar/declarations.py | Renamed DeclNormative to DeclRequirement and added priority attribute assignment |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
__copy__and__deepcopy__operators implemented