Skip to content

[mypyc] feat: extend get_expr_length for listcomp and genexp [4/4] - #19928

Draft
BobTheBuidler wants to merge 14 commits into
python:masterfrom
BobTheBuidler:patch-10
Draft

BobTheBuidler wants to merge 14 commits into
python:masterfrom
BobTheBuidler:patch-10

Conversation

@BobTheBuidler

@BobTheBuidler BobTheBuidler commented Sep 26, 2025 •

Copy link
Copy Markdown
Contributor

This PR extends get_expr_length to work with ListComprehension and GeneratorExpression.

All of the get_expr_length PRs are entirely independent and can be reviewed/merged in any order.

Comment thread mypyc/irbuild/for_helpers.py Outdated
and isinstance(expr.node, Var)
and expr.node.is_final
and isinstance(expr.node.final_value, str)
and expr.node.has_explicit_value

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I realized when looking that this line is unnecessary if the above checks pass

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

#19930 renders this irrelevant

@BobTheBuidler BobTheBuidler changed the title [mypyc] feat: extend get_expr_length for listcomp and genexp Sep 26, 2025
@BobTheBuidler
BobTheBuidler marked this pull request as ready for review September 26, 2025 06:58
r6 = r26
goto L1
L8:
r27 = var_object_size r0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This doesn't look right, should be 9

@BobTheBuidler
BobTheBuidler marked this pull request as draft September 28, 2025 13:58
@BobTheBuidler BobTheBuidler changed the title [mypyc] feat: extend get_expr_length for listcomp and genexp Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant