Skip to content

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

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

Python: Ignore await and typing ellipsis as non-effectful statements#22291
maxfischer2781 wants to merge 9 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 currently misses generic Protocols (e.g. class Foo(Protocol[T]) and class Bar(Foo[int])). This seems to be a parser bug, see #22298. In principle, the code checks for subscriptions and should be able to pick up such cases once the parser is fixed. To avoid going out of scope here, the parser fixes are in #22301.

@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
@maxfischer2781
maxfischer2781 requested a review from a team as a code owner August 7, 2026 17:01
@maxfischer2781 maxfischer2781 changed the title Ignore await and typing ellipsis as non-effectful statements Python: Ignore await and typing ellipsis as non-effectful statements Aug 7, 2026
@maxfischer2781
maxfischer2781 force-pushed the python/stmt_effects_async_stub branch from fd59c25 to 32a698d Compare August 7, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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