[Python] Does python STORE_SUBSCR bytecode instruction push back to the stack?

Discussão em 'Python' iniciado por Stack, Julho 30, 2025.

  1. Stack

    Stack Membro Participativo

    The official description of STORE_SUBSCR bytecode instruction (https://docs.python.org/3/library/dis.html) gives the following explanation of how it works:

    ''' STORE_SUBSCR¶ Implements:

    key = STACK.pop() container = STACK.pop() value = STACK.pop() container[key] = value '''

    It seems strange that the container needs to be poped from the stack but does not need to be pushed back (other bytecode ops do push back the operation results). Why is this so? Is this correct?

    I've tried searching the official docs as well as other sites.

    Continue reading...

Compartilhe esta Página