Inside the Python VM: Function Objects
摘要
In the previous chapter, we got a general overview of Code Objects wrapped inside functions. Code Objects are created during the compilation process—when a program runs, they are loaded via the LOAD_CONST instruction and wrapped into functions. However, unlike Code Objects, functions are not pre-built; they are created during runtime through the MAKE_FUNCTION instruction. In this chapter, let’s take a closer look at how Python function objects work.