Satori Komeiji's Programming Classroom
Author

Satori Komeiji's Programming Classroom

Python and Rust developer; I write about any topics you're interested in. Follow me! (#^.^#)

33
Articles
0
Likes
0
Views
0
Comments
Recent Articles

Latest from Satori Komeiji's Programming Classroom

33 recent articles
Satori Komeiji's Programming Classroom
Satori Komeiji's Programming Classroom
Dec 2, 2024 · Fundamentals

Master Python Generators (And the Odd Feud Behind It)

This article walks through Python generators in depth—covering basic yield behavior, the __next__, send, throw, and close methods, pre‑activation states, delegation with yield from, generator expressions pitfalls, and their role in coroutine implementation—while briefly recounting a personal conflict that sparked the write‑up.

CoroutinesGeneratorsPython
0 likes · 28 min read
Master Python Generators (And the Odd Feud Behind It)
Satori Komeiji's Programming Classroom
Satori Komeiji's Programming Classroom
Nov 19, 2024 · Fundamentals

How Python Calls Functions Under the Hood

This article explains the low‑level mechanics of Python function calls, distinguishing Python‑implemented and C‑implemented functions, dissecting the bytecode generated for a simple call, and walking through the CPython CALL instruction, stack layout, method handling, and the relationship between PyFunctionObject, PyFrameObject, and PyCodeObject.

PyCFunctionObjectbytecodefunction call
0 likes · 10 min read
How Python Calls Functions Under the Hood
Satori Komeiji's Programming Classroom
Satori Komeiji's Programming Classroom
Nov 11, 2024 · Fundamentals

How Does the Python VM Capture Exceptions?

The article explains Python's exception handling implementation, detailing how the virtual machine executes try/except/else/finally blocks, the bytecode instructions generated for each clause, the static exception table used for fast dispatch, and the effects of return and del statements on control flow and object lifetimes.

Pythonbytecodeexception-handling
0 likes · 19 min read
How Does the Python VM Capture Exceptions?
Satori Komeiji's Programming Classroom
Satori Komeiji's Programming Classroom
Nov 7, 2024 · Fundamentals

How Does Python’s VM Implement and Throw Exceptions?

The article dissects Python’s exception mechanism, showing how the interpreter and virtual machine raise, record, and propagate errors via thread‑state objects, traceback chains, and C‑level APIs, while also illustrating generator return values, Java checked exceptions, and the final printing of tracebacks.

C APIException HandlingRuntime
0 likes · 16 min read
How Does Python’s VM Implement and Throw Exceptions?
Satori Komeiji's Programming Classroom
Satori Komeiji's Programming Classroom
Oct 28, 2024 · Fundamentals

How Python Implements Static Lookup for Local Variables and Its Relationship to the Local Namespace

The article explains that CPython stores function local variables in a statically‑indexed array (f_localsplus), accesses them via GETLOCAL/SETLOCAL macros, and builds the locals() dictionary on demand, showing how exec, variable assignment order, and the hidden local namespace interact with this mechanism.

CPythonPythonbytecode
0 likes · 27 min read
How Python Implements Static Lookup for Local Variables and Its Relationship to the Local Namespace