Skip to content

#362 - Improve static type safety for array feature structures - #363

Merged
reckart merged 1 commit into
mainfrom
feature/362-Improve-static-type-safety-for-array-feature-structures
Jul 31, 2026
Merged

#362 - Improve static type safety for array feature structures#363
reckart merged 1 commit into
mainfrom
feature/362-Improve-static-type-safety-for-array-feature-structures

Conversation

@reckart

@reckart reckart commented Jul 31, 2026

Copy link
Copy Markdown
Member

What's in the PR

  • Introduce ArrayBase and FSArrayBase static base classes for array feature structures with typed elements
  • Add is_array_fs() and is_fs_array() type guards for static narrowing of array FS instances
  • Extend Type.attrs_post_init base selection to pick ArrayBase or FSArrayBase as needed, skipping re-declaration of elements
  • Apply type guard narrowing at array access sites in cas.py, json.py, util.py, and xmi.py to resolve attribute errors
  • Annotate CasJsonSerializer._serialize_feature_structure() parameter for consistency

How to test manually

  • No specific test procedure

Automatic testing

  • PR includes unit tests

Documentation

  • PR updates documentation

@reckart reckart added this to the 0.12.0 milestone Jul 31, 2026
@reckart reckart self-assigned this Jul 31, 2026
@reckart reckart added this to Kanban Jul 31, 2026
@github-project-automation github-project-automation Bot moved this to In progress in Kanban Jul 31, 2026
- Introduce ArrayBase and FSArrayBase static base classes for array feature structures with typed elements
- Add is_array_fs() and is_fs_array() type guards for static narrowing of array FS instances
- Extend Type.__attrs_post_init__ base selection to pick ArrayBase or FSArrayBase as needed, skipping re-declaration of elements
- Apply type guard narrowing at array access sites in cas.py, json.py, util.py, and xmi.py to resolve attribute errors
- Annotate CasJsonSerializer._serialize_feature_structure() parameter for consistency
@reckart
reckart force-pushed the feature/362-Improve-static-type-safety-for-array-feature-structures branch from 6cd34c0 to d4a0cd3 Compare July 31, 2026 20:48
@reckart
reckart merged commit 48e627f into main Jul 31, 2026
5 checks passed
@reckart
reckart deleted the feature/362-Improve-static-type-safety-for-array-feature-structures branch July 31, 2026 20:52
@github-project-automation github-project-automation Bot moved this from In progress to Done in Kanban Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant