3 ms·
I can't reproduce in 2.7.16 and 3.7 either. The tuple20 is an interesting one, using lists instead of tuples it doesn't explode in size, at least in 2.7
by PartiallyTyped 6y ago
I can't reproduce in 2.7.16 and 3.7 either. The tuple20 is an interesting one, using lists instead of tuples it doesn't explode in size, at least in 2.7
- eesmith 6y agoThat's because the peephole optimizer only looks at constants, and lists aren't constant while tuples are. It doesn't explode in size. The peephole optimizer is checking for uniqueness, via a dict, and evaluating hash() of that constant takes a very long time.