Skip to content

Conversation

@junkmd
Copy link
Collaborator

@junkmd junkmd commented Jan 18, 2026

Summary

This pull request introduces comprehensive tests for ITypeComp, improving type hints for ITypeComp.Bind.

Improvements

Enhanced Type Hints

The return type hints for ITypeComp.Bind now leverage typing.Literal to precisely define the possible "kind" strings ("function", "variable", "type"). This change allows static analysis tools to provide more accurate feedback.

Comprehensive Testing

New tests have been added to cover a wider range of ITypeComp.Bind's behaviors, including binding to enum members, interface members, and enum types.

Clearer Documentation

Clarifying comments have been integrated directly into the ITypeComp.Bind method's implementation.
These comments explain the rare DESCKIND_IMPLICITAPPOBJ type and the implications of encountering DESCKIND_MAX, demystifying complex COM behaviors for users and maintainers.

Adds a test case to verify that calling `ITypeComp.Bind` with a non-existent
name correctly raises a `NameError`.
…POBJ`.

Adds clarifying comments within the `ITypeComp.Bind` method in `typeinfo.py` to explain
the nature and rarity of the `DESCKIND_IMPLICITAPPOBJ` type description kind.
Adds clarifying comments within the `ITypeComp.Bind` method in `typeinfo.py` to
explain that `DESCKIND_MAX` is not a valid return value from `ITypeComp::Bind`
and implies a malformed type library.
Refines the return type hints for the `ITypeComp.Bind` method in `typeinfo.py`
to use `typing.Literal` for the kind string, providing more precise type
information and enhancing static analysis capabilities.
@junkmd junkmd added this to the 1.4.15 milestone Jan 18, 2026
@junkmd junkmd added tests enhance or fix tests typing related to Python static typing system labels Jan 18, 2026
@codecov
Copy link

codecov bot commented Jan 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.26%. Comparing base (1aab6ae) to head (6dfa711).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #906      +/-   ##
==========================================
+ Coverage   86.11%   86.26%   +0.14%     
==========================================
  Files         132      132              
  Lines       12288    12326      +38     
==========================================
+ Hits        10582    10633      +51     
+ Misses       1706     1693      -13     

☔ View full report in Codecov by Sentry.
📢 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 1fc72e0 into enthought:main Jan 18, 2026
52 checks passed
@junkmd junkmd deleted the typecomp_tests branch January 18, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests enhance or fix tests typing related to Python static typing system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant