mypy icon indicating copy to clipboard operation
mypy copied to clipboard

[mypyc] feat: specialize `any` and `all` using for loop helpers if possible [1/2]

Open BobTheBuidler opened this issue 3 months ago • 0 comments

This PR modifies the any and all call specializers to use our for loop helpers in cases where they can be used.

This is only marginally helpful now but will become more impactful with the addition of ForMap and ForFilter helpers, as well as any future helpers.

While the private helpers might seem unnecessary at this point, I intend to use them for future specialization use cases such as list(iterable) and tuple(iterable) as discussed in #19649 , and sum(iterable) which will come shortly after this PR.

This PR is ready for review

Update: The sum(iterable) is now ready in #19950. It's a bit more involved than this one so I'm going to leave it separate.

Update: The helpers are no longer private

BobTheBuidler avatar Sep 28 '25 21:09 BobTheBuidler