Tagged articles
5 articles
Page 1 of 1
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
Test Development Learning Exchange
Test Development Learning Exchange
Oct 26, 2023 · Fundamentals

Understanding Global and Local Variables in Python

This article explains the concepts and practical usage scenarios of global and local variables in Python, illustrating their roles in data sharing, configuration, temporary storage, scope isolation, and exception handling with clear code examples for interface automation and general programming.

Code ExamplesPythonglobal variables
0 likes · 5 min read
Understanding Global and Local Variables in Python
Java Interview Crash Guide
Java Interview Crash Guide
Oct 18, 2021 · Backend Development

Why Thread Safety Fails in Java and How to Ensure It

This article explains how variable sharing in multithreaded Java programs leads to thread‑unsafe behavior, explores the JVM memory model and stack frame structure, and demonstrates practical ways to achieve thread safety by keeping variables thread‑local or using proxy objects.

JVMconcurrencyjava
0 likes · 10 min read
Why Thread Safety Fails in Java and How to Ensure It