How global variables work in Python bytecode

Think globally, act locally. Who knew this oft-touted phrase was referring to Python bytecode? Last time we acted on learning how local variables work , today let’s think about how global variables might work. I came into my own bytecode journey assuming that a “global” was no different than a “local,” it was just at the outermost scope of a module. And boy, was I mistaken. While the VM isn’t even…