LEGB rule
2 posts2 contributors
+ FollowBe the first to follow this
Write about itArticles about LEGB rule
How Python’s Namespace Concept Differs from Other Programming Languages
Explore the unique nature of Python namespaces compared to languages like C#, Java, and C++. Discover how Python treats namespaces as dynamic, runtime objects (dictionaries) that map names to objects, enabling flexible code modification. Contrast this with the compile-time namespaces in other languages, which serve primarily for code organization and collision prevention, lacking runtime mutability and dynamic lookup.
Understanding Namespaces in Python
Namespaces in Python help manage variable scope and prevent conflicts. This article explains the LEGB rule, which determines how Python looks up variables in Local, Enclosing, Global, and Built-in scopes.

