Skip to content

LEGB rule

2 posts2 contributors

+ FollowBe the first to follow this
Write about it

Articles about LEGB rule

  1. 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.

    Jayant KumarJayant Kumar1,7031,000
  2. 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.

    Vipul MalhotraVipul Malhotra2,0501,000