Skip to content

Conversation

@junkmd
Copy link
Collaborator

@junkmd junkmd commented Jan 17, 2026

Closes #458

Refactoring:

Type hints for CoGetClassObject and client.GetClassObject.

Tests:

New tests explicitly validate the dynamic dispatch mechanism of IClassFactory.CreateInstance based on type information availability.

Add tests for `IClassFactory.CreateInstance` with `dynamic=True` to verify
that it returns `lazybind.Dispatch` when type information is available and
`dynamic._Dispatch` when it's not.
Remove `TYPE_CHECKING` guard for `overload` definitions in `GetClassObject`.
Refine type hints for the `interface` parameter and return types in `GetClassObject`
to improve accuracy and consistency.
Remove `TYPE_CHECKING` guard for `overload` definitions in `CoGetClassObject`.
Refine type hints for the `interface` parameter and return types in
`CoGetClassObject` to improve accuracy and consistency.
@junkmd junkmd added this to the 1.4.15 milestone Jan 17, 2026
@junkmd junkmd added tests enhance or fix tests typing related to Python static typing system labels Jan 17, 2026
@codecov
Copy link

codecov bot commented Jan 17, 2026

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #904      +/-   ##
==========================================
+ Coverage   86.01%   86.06%   +0.04%     
==========================================
  Files         132      132              
  Lines       12255    12270      +15     
==========================================
+ Hits        10541    10560      +19     
+ Misses       1714     1710       -4     

☔ 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 921b699 into enthought:main Jan 17, 2026
88 of 101 checks passed
@junkmd junkmd deleted the test_dynamic_getclassobj branch January 17, 2026 15:13
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.

fix client.GetClassObject type annotations and add tests

1 participant