Skip to content

Commit 3728463

Browse files
committed
Merge branch 'for-loop-len-cache' of https://github.com/BobTheBuidler/mypy into for-loop-len-cache
2 parents d2c9826 + 1da0f69 commit 3728463

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

mypyc/irbuild/for_helpers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,10 @@ def get_expr_length(expr: Expression) -> int | None:
12111211
and expr.node.has_explicit_value
12121212
):
12131213
return len(expr.node.final_value)
1214-
# TODO: extend this, unrolling should come with a good performance boost
1214+
# TODO: extend this, passing length of listcomp and genexp should have worthwhile
1215+
# performance boost and can be (sometimes) figured out pretty easily. set and dict
1216+
# comps *can* be done as well but will need special logic to consider the possibility
1217+
# of key conflicts
12151218
return None
12161219

12171220

mypyc/test-data/irbuild-lists.test

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,4 +901,3 @@ L9:
901901
L10:
902902
a = r3
903903
return 1
904-

0 commit comments

Comments
 (0)