Skip to content

Remove ..._Impl comments generation and add member‑level docstrings under if TYPE_CHECKING. - #966

Merged
junkmd merged 8 commits into
mainfrom
remove_code_template_for_interface_comment
Oct 13, 2026
Merged

junkmd merged 8 commits into
mainfrom
remove_code_template_for_interface_comment

Conversation

@junkmd

@junkmd junkmd commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

Closes #530

We are removing the ComInterfaceBodyImplCommentWriter class.

Before, this class made special comments (class …_Impl) in the generated Python files.

Instead of old comment styles, codegenerator writes docstrings directly after definitions inside an if TYPE_CHECKING: block.
They will be on the same line as the definition.
It isn't the standard PEP 257 style, but Python accepts it without errors, and a code formatter can fix the style.

When COM type info has a doc comment, the generator now adds it to the
created method stub. This helps IDEs show better help text for generated
methods and makes the type annotation output easier to understand.
- attach the getter doc comment to generated property objects when available
- keep setter-only properties untouched
- preserve generated `TYPE_CHECKING` annotations as valid Python
- update the related `typeannotator` regression expectations
@junkmd junkmd added this to the 1.5.0 / Support Python 3.15 milestone Oct 13, 2026
@junkmd junkmd added typing related to Python static typing system coding style Topics related to style, formatters, linters, and delinting. labels Oct 13, 2026
@codecov-commenter

codecov-commenter commented Oct 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.20%. Comparing base (8f4137c) to head (40b08b0).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #966      +/-   ##
==========================================
- Coverage   89.21%   89.20%   -0.02%     
==========================================
  Files         143      142       -1     
  Lines       13933    13902      -31     
==========================================
- Hits        12431    12401      -30     
+ Misses       1502     1501       -1     

☔ 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 added this pull request to stack #968 October 13, 2026 14:52
@junkmd
junkmd merged commit c7436d1 into main Oct 13, 2026
206 of 226 checks passed
@junkmd
junkmd deleted the remove_code_template_for_interface_comment branch October 13, 2026 15:49
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.

Can we remove the comments generated by CodeGenerator.ComInterfaceBody?

2 participants