Skip to content

Refine type hints for COM object creation and retrieval.#940

Merged
junkmd merged 5 commits into
enthought:mainfrom
junkmd:client_typehints_literals
Jun 14, 2026
Merged

Refine type hints for COM object creation and retrieval.#940
junkmd merged 5 commits into
enthought:mainfrom
junkmd:client_typehints_literals

Conversation

@junkmd

@junkmd junkmd commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR focuses type-hint improvements for core COM object creation and retrieval functions.
The goal is solely to enhance static type safety and developer experience within IDEs by providing precise @overload signatures and Literal hints.

Changes

1. Static Type Resolution for Object Creation

  • Functions affected: CreateObject, GetActiveObject, CoGetObject
  • Focus: Added Literal type hints to the dynamic parameter.

2. Overload Mapping for Interface Specification

  • Functions affected: CreateObject, GetActiveObject, GetClassObject, CoGetClassObject, CoCreateInstanceEx
  • Focus: Refined @overload signatures to link the interface argument directly to the function's return type in the eyes of static analyzers.

3. Type-Safe Pointers for Low-Level Compatibility

  • Functions affected: CreateObject, GetClassObject, CoGetClassObject, CoCreateInstanceEx
  • Focus: Expanded the type definition of pServerInfo to include _CArgObject.

@junkmd junkmd added this to the 1.4.17 milestone Jun 14, 2026
@junkmd junkmd added the typing related to Python static typing system label Jun 14, 2026
@codecov-commenter

codecov-commenter commented Jun 14, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.94%. Comparing base (39cc301) to head (97fb345).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #940   +/-   ##
=======================================
  Coverage   88.93%   88.94%           
=======================================
  Files         139      139           
  Lines       13642    13649    +7     
=======================================
+ Hits        12133    12140    +7     
  Misses       1509     1509           

☔ 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 74300b2 into enthought:main Jun 14, 2026
96 of 99 checks passed
@junkmd junkmd deleted the client_typehints_literals branch June 14, 2026 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

typing related to Python static typing system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants