reading-notes


Project maintained by will-ing Hosted on GitHub Pages — Theme by mattgraham

Scope

scope rules how variables and names are looked up in your code. It determines the visibility of a variable within the code.

LEGB rule

Python scopes are implemented as dictionaries that map names to objects

Names that you define in the enclosing Python scope are commonly known as nonlocal names

From the moment you start a Python program, you’re in the global Python scope

Main Page