Skip to content

#334 - Add more type annotations - #361

Merged
reckart merged 1 commit into
mainfrom
refactoring/334-Add-more-type-annotations
Jul 31, 2026
Merged

#334 - Add more type annotations#361
reckart merged 1 commit into
mainfrom
refactoring/334-Add-more-type-annotations

Conversation

@reckart

@reckart reckart commented Jul 31, 2026

Copy link
Copy Markdown
Member

What's in the PR

  • Add lxml-stubs dev dependency for improved type checking of lxml code
  • Fix incorrect return type on _serialize_float_value (was Union[float, str], always returns str)
  • Fix incorrect etree._ElementTree call to use public etree.ElementTree factory
  • Introduce module-level Element type alias for etree._Element to avoid private-usage warnings in annotations
  • Update XMI serializer to pass attrib= explicitly instead of unpacking dict as **kwargs for type safety
  • Update element parameter annotations to use Optional[Element] where applicable to match actual caller behavior

How to test manually

  • No specific test procedure

Automatic testing

  • PR includes unit tests

Documentation

  • PR updates documentation

- Add lxml-stubs dev dependency for improved type checking of lxml code
- Fix incorrect return type on `_serialize_float_value` (was `Union[float, str]`, always returns `str`)
- Fix incorrect `etree._ElementTree` call to use public `etree.ElementTree` factory
- Introduce module-level `Element` type alias for `etree._Element` to avoid private-usage warnings in annotations
- Update XMI serializer to pass `attrib=` explicitly instead of unpacking dict as `**kwargs` for type safety
- Update element parameter annotations to use `Optional[Element]` where applicable to match actual caller behavior
@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
@reckart
reckart merged commit f869cd5 into main Jul 31, 2026
5 checks passed
@reckart
reckart deleted the refactoring/334-Add-more-type-annotations branch July 31, 2026 20:38
@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