Closed
Description
Currently set(f(x) for x in it)
is slower than {f(x) for x in it}
, since the first one is evaluated like this:
set([f(x) for x in it]) # Note extra [...]!
We create a needless temporary list, which adds overhead.
It would be better to generate similar code for both alternatives.
For extra credit, do a similar optimization for other suitable candidates that are
handled by mypyc.irbuild.specialize.translate_safe_generator_call
.