Skip to content

Remove dead early return in _coclass_meta.__new__ - #1016

Merged
junkmd merged 1 commit into
enthought:mainfrom
jeanluyac-sketch:remove-dead-coclass-meta-branch
Dec 2, 2026
Merged

junkmd merged 1 commit into
enthought:mainfrom
jeanluyac-sketch:remove-dead-coclass-meta-branch

Conversation

@jeanluyac-sketch

Copy link
Copy Markdown
Contributor

Closes #655

Removes the early return self for bases == (object,) in _coclass_meta.__new__. CoClass is defined as class CoClass(COMObject, metaclass=_coclass_meta), so bases is never (object,) there, and coverage shows the branch is never entered (as noted in the issue). The similar check in _post_coinit/unknwn.py is live (it identifies IUnknown itself) and is left alone.

Tested on Windows 11 / Python 3.14: unittest suite on this branch and on main gives the same results (813 tests; the leaks tests were excluded because test_collections.test_leaks_1 hangs on main too on my machine, and the Word tests pass when run on their own).

AI assistance: this change was drafted with Claude; I reviewed it and ran the tests myself.

@codecov-commenter

codecov-commenter commented Nov 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.63%. Comparing base (6075f1b) to head (7f84b79).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1016   +/-   ##
=======================================
  Coverage   92.62%   92.63%           
=======================================
  Files         154      154           
  Lines       16870    16868    -2     
=======================================
- Hits        15626    15625    -1     
+ Misses       1244     1243    -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 commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

@jeanluyac-sketch

Heads up—this commit is showing up as Unverified.

A signature is present, so GitHub just isn't able to validate it (common culprits: the key isn't registered as a Signing key, an email mismatch, or Claude Code signing settings).

Could you re-push with a valid signature when you get a chance?

Quick refs: https://docs.github.com/en/authentication/managing-commit-signature-verification

Feel free to amend and force-push, or replace it with a new commit. Sorry for the hassle and thanks!

@jeanluyac-sketch
jeanluyac-sketch force-pushed the remove-dead-coclass-meta-branch branch from 20dca93 to 7f84b79 Compare December 2, 2026 01:11
@jeanluyac-sketch

Copy link
Copy Markdown
Contributor Author

Thanks @junkmd, I re-pushed the commit; it is now signed and shows as Verified. Sorry for the hassle.

(AI-assisted: Claude helped prepare this change; I reviewed it.)

@junkmd junkmd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@junkmd
junkmd merged commit 2cc0f5d into enthought:main Dec 2, 2026
134 of 135 checks passed
@junkmd junkmd added this to the 1.5.1 milestone Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove the dead code that performs an early return with if bases == (object,) in _coclass_meta.

4 participants