I saw in Python documentation that the BUILD_TUPLE
instruction "Creates a tuple consuming count items from the stack, and pushes the resulting tuple onto the stack."
It really pushes the tuple itself? What if the tuple contains a large number of elements? How it is placed on stack?
This answer applies to CPython specifically, but all CPython objects live on a private heap.
Note, everything in Python is an object. The only thing going onto the interpreter stack is a PyObject pointer. The stack here being an implementation detail of the CPython runtime. Source code is compiled to bytecode, which is executed on this stack-based virtual machine.