Add access_mode property to Attribute classes (#260) #307
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.
Summary
Resolves #260 by adding an
access_modeproperty to the Attribute class hierarchy, replacing the_attribute_to_access()free function.Changes
AttributeAccessModetype definition (Literal["r", "w", "rw"]) to the attributes moduleAttributeclass abstract with an abstractaccess_modepropertyaccess_modein all attribute subclasses:AttrR: returns"r"AttrW: returns"w"AttrRW: returns"rw"AttributeAccessModefrom the attributes module_attribute_to_access()function usage in PVA PVI code with the new property_attribute_to_access()function and its TODO commentTest plan
tox -e tests)tox -e type-checking)test_attribute_access_mode()verifies the property returns correct valuesBackward Compatibility
This change is fully backward compatible:
_attribute_to_access()function was internal only, never part of public API🤖 Generated with Claude Code