Currently we can reason about code like a + b if a and b are already known to be ints, but the type information disappears as soon as a and b get stored into memory such as tuples. We should be able to reason about
tup= (a, b)
tup[0] +tup[1]
and have the optimizer "see through" the BUILD_TUPLE instruction.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Activity
eendebakpt commented on May 17, 2026
The optimization was implemented via #128940 and #133003. The issue can be closed.