1. Official Python Documentation
Glossary:
Interpreter: "The program that reads and executes Python code. It has two parts: a compiler that translates the source code into an intermediate code called bytecode
and a virtual machine that executes the bytecode." This confirms that translation to bytecode is part of the interpreter's process before the virtual machine executes it.
Bytecode: "Python source code is compiled into bytecode... This bytecode is then executed by the Python virtual machine." This establishes the sequence of compilation to bytecode
followed by execution.
Source: Python Software Foundation. (2024). Glossary. Python 3.12.3 documentation. Retrieved from https://docs.python.org/3/glossary.html#term-interpreter
2. Official Python Documentation
FAQ:
Section: "Is Python an interpreted or a compiled language?"
Content: "Python is an interpreted language
as opposed to a compiled one
though the distinction can be blurry because of the presence of the bytecode compiler. This means that source files can be run directly without explicitly creating an executable... Python source code is always compiled into bytecode
and this bytecode is then executed by the Python Virtual Machine (PVM)." This source clarifies the compile-to-bytecode step happens first
followed by execution.
Source: Python Software Foundation. (2024). Frequently Asked Questions. Python 3.12.3 documentation. Retrieved from https://docs.python.org/3/faq/general.html#is-python-a-compiled-or-an-interpreted-language
3. MIT OpenCourseWare
6.0001 Introduction to Computer Science and Programming in Python
Fall 2016:
Section: Lecture 2 Notes
"Kinds of languages"
Content: "Python uses a hybrid approach. It compiles source code to a bytecode. This bytecode is then interpreted by a virtual machine." This academic source validates the sequence where source code is first compiled to bytecode
which is then interpreted/executed.
Source: Guttag
J. (2016). Lecture 2: Branching
Conditionals
and Iteration. MIT OpenCourseWare
6.0001 Introduction to Computer Science and Programming in Python. Retrieved from https://ocw.mit.edu/courses/6-0001-introduction-to-computer-science-and-programming-in-python-fall-2016/resources/lec2/