Refine type hints and enhance dynamic dispatch tests for client.GetClassObject, CoGetClassObject and IClassFactory.#904
Merged
junkmd merged 3 commits intoenthought:mainfrom Jan 17, 2026
Conversation
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.
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #458
Refactoring:
Type hints for
CoGetClassObjectandclient.GetClassObject.Tests:
New tests explicitly validate the dynamic dispatch mechanism of
IClassFactory.CreateInstancebased on type information availability.