BestHub
Discover
Artificial IntelligenceBackend DevelopmentMobile DevelopmentProduct ManagementCloud NativeFrontend DevelopmentFundamentalsBig DataCloud ComputingGame DevelopmentR&D ManagementOperationsDatabasesInformation SecurityBlockchainUser Experience DesignInterview ExperienceIndustry Insights
View all →
TopicsTagsTrendsRanking
Sign in
Discover
Artificial Intelligence Backend Development Mobile Development Product Management Cloud Native Frontend Development Fundamentals Big Data Cloud Computing Game Development R&D Management Operations Databases Information Security Blockchain User Experience Design Interview Experience Industry Insights View all →
TopicsTagsTrendsRanking
Sign in
  1. Home
  2. / Tags
  3. / variable lookup
Satori Komeiji's Programming Classroom
Satori Komeiji's Programming Classroom
Oct 14, 2024 · Fundamentals

How Python’s VM Resolves Variable Lookups: LEGB, locals(), globals() and nonlocal

The article explains Python's variable lookup mechanism, detailing the LEGB rule, static storage of local variables, dynamic global namespace updates, common UnboundLocalError scenarios, bytecode inspection, and how the global and nonlocal keywords modify scope resolution.

LEGBglobalslocals
0 likes · 12 min read
How Python’s VM Resolves Variable Lookups: LEGB, locals(), globals() and nonlocal
BestHub

Editorial precision for engineers who prefer signal over noise. Deep reads, careful curation, and sharper frontiers in software.

Best Hub for Dev. Power Your Build.
Navigation
Status Discover Tags Topics System Status Privacy Terms Rss Feed