Skip to content

Ignore await and typing ellipsis as non-effectful statements - #22291

Open
maxfischer2781 wants to merge 8 commits into
github:mainfrom
maxfischer2781:python/stmt_effects_async_stub
Open

Ignore await and typing ellipsis as non-effectful statements#22291
maxfischer2781 wants to merge 8 commits into
github:mainfrom
maxfischer2781:python/stmt_effects_async_stub

Conversation

@maxfischer2781

@maxfischer2781 maxfischer2781 commented Aug 6, 2026

Copy link
Copy Markdown

This PR extends the Python StatementNoEffect query to ignore await and many typing ellipses expression statements.

The Protocol check covers transitive subclasses of Protocol but currently misses generic Protocols (e.g. class Foo(Protocol[T]) and class Bar(Foo[int])); I have only been able to select subscripts outside of class statements. The current state should already eliminate many false positives, but the proper one needs more investigation from my side - this might need to be covered in a later PR if it turns out to be too complicated now.

@github-actions github-actions Bot added the Python label Aug 6, 2026
@maxfischer2781
maxfischer2781 force-pushed the python/stmt_effects_async_stub branch from ddddc92 to 012e138 Compare August 6, 2026 18:50
@maxfischer2781
maxfischer2781 marked this pull request as ready for review August 6, 2026 18:51
@maxfischer2781
maxfischer2781 requested a review from a team as a code owner August 6, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False positive – "Statement has no effect" for Python type hint ellipsis LGTM.com - false positive "Statement has no effect" for Python await

1 participant