Skip to content

Enhance type hints and make type containers generic for compatibility in tools. - #974

Merged
junkmd merged 2 commits into
enthought:mainfrom
junkmd:enhance_typedesc_generic_type
Oct 22, 2026
Merged

junkmd merged 2 commits into
enthought:mainfrom
junkmd:enhance_typedesc_generic_type

Conversation

@junkmd

@junkmd junkmd commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

This is a static typing enhancement similar to #973.

…nhance type checking in code generator.

Since `typedesc.*Interface*` cannot be mixins for each other, `TypeIs` is more
appropriate than `TypeGuard` for type narrowing.
- Make `Typedef`, `PointerType`, `ArrayType`, and `SAFEARRAYType` generic to
  facilitate future refactoring in parser and codegenerator.
- Add `overload`s and type annotations to `PTR`, `midlSAFEARRAY`, and
  `get_real_type`.
- Note: `CvQualifiedType` is not genericized as it is currently unused and
  uninstantiated.
@junkmd junkmd added this to the 1.5.0 / Support Python 3.15 milestone Oct 22, 2026
@junkmd junkmd added typing related to Python static typing system coding style Topics related to style, formatters, linters, and delinting. labels Oct 22, 2026
@junkmd junkmd changed the title Enhance type hints and make type containers generic for compatibility. Enhance type hints and make type containers generic for compatibility in tools. Oct 22, 2026
@codecov-commenter

codecov-commenter commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.57%. Comparing base (c4fe55d) to head (94c8ad9).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #974   +/-   ##
=======================================
  Coverage   89.56%   89.57%           
=======================================
  Files         143      143           
  Lines       14170    14175    +5     
=======================================
+ Hits        12692    12697    +5     
  Misses       1478     1478           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@junkmd
junkmd merged commit b8e3b31 into enthought:main Oct 22, 2026
150 of 151 checks passed
@junkmd
junkmd deleted the enhance_typedesc_generic_type branch October 22, 2026 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

coding style Topics related to style, formatters, linters, and delinting. typing related to Python static typing system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants