Skip to content

Pass along # type: ... annotation comments - #19

Merged
jon-edward merged 2 commits into
jon-edward:mainfrom
mdboom:pass-along-ignore
May 11, 2026
Merged

jon-edward merged 2 commits into
jon-edward:mainfrom
mdboom:pass-along-ignore

Conversation

@mdboom

@mdboom mdboom commented May 11, 2026

Copy link
Copy Markdown
Contributor

For cuda-core, we are running into a mypy "bug" when annotating __ior__ and __isub__. It's pretty hairy, maybe unlikely to be resolved any time soon, and even typeshed is currently just adding a # type: ignore[...] annotation to get around it.

In any event, these sorts of "escape hatches" to work around type checker shortcomings seems like it will be generally useful. This PR just passes these type annotations in the .pyx along to the .pyi file.

@codecov

codecov Bot commented May 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.32%. Comparing base (b32e49a) to head (1e7b293).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #19      +/-   ##
==========================================
+ Coverage   95.19%   95.32%   +0.13%     
==========================================
  Files          22       22              
  Lines        1228     1263      +35     
==========================================
+ Hits         1169     1204      +35     
  Misses         59       59              

☔ 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.

@mdboom
mdboom marked this pull request as ready for review May 11, 2026 13:58
@mdboom

mdboom commented May 11, 2026

Copy link
Copy Markdown
Contributor Author

The handling of files with multi-line statements is a bit complex in this PR. There may be a better level of abstraction to do this at. I figure I'd pass it to your expertise first (@jon-edward) to see if you had suggestions before trying to find a better solution.

@jon-edward

Copy link
Copy Markdown
Owner

There's probably no better way to accomplish this, preprocessing is done to account for what I’ve observed of Cython parser behavior so any workaround is going to be pretty complicated when working around newline and comment transforms. I do like your solution though and appreciate the tests

I’m away from my computer for the normal East coast workday, I’ll give this a more thorough look tonight and will probably end up merging

@jon-edward
jon-edward merged commit e0f543d into jon-edward:main May 11, 2026
16 checks passed
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.

2 participants