Programming Search⌘K

Conceptcore

Lexical scope

Also called static scope, lexical scoping, block scope, name resolution, shadowing.

The scope of a declaration is the part of the program text where its name refers to it. With lexical scope, the text decides what each name means, not the calls at run time.

Applies to
core-languages

Idea

A name in a program refers to a variable, a function or a type. The scope of a declaration is the part of the program text where the name refers to that declaration. With lexical scope, also called static scope, the scope follows the structure of the text. To find what a name means, start at the use and read outward, block by block, to the nearest declaration of the name. The answer is fixed before the program runs, and the calls that the program makes at run time do not change it.

The other rule is dynamic scope. With dynamic scope, a name refers to the most recent binding that is still active at run time, which is usually a variable of the caller. The same program gives different results under the two rules. Python uses lexical scope, so reads_level always sees the module variable:

level = "global"


def reads_level():
    return level


def caller():
    level = "caller"
    return reads_level()


print(reads_level())
print(caller())
Output
global
global

Bash uses dynamic scope, so the same function sees the variable of its caller:

level="global"

reads_level() {
  echo "$level"
}

caller() {
  local level="caller"
  reads_level
}

reads_level
caller
Output
global
caller

Most languages use lexical scope for their variables. A reader can understand a function from its text and the text around it, with no knowledge of the callers. A compiler can find each variable at compile time. Dynamic scope is still the rule for variables in command shells, such as Bash and PowerShell.

How it works

Regions nest. A block, a function body, a class body and a module are regions of the text. The Revised Report on ALGOL 60 states the rule for blocks: "Every block automatically introduces a new level of nomenclature." An identifier that is declared in the block is local to it, and the other identifiers are non-local.1 To resolve a name, the compiler looks in the innermost region that contains the use, then in the region around it, and so on to the outermost region. The first declaration that it finds is the one that the name refers to.

An inner declaration hides an outer one. When an inner region declares a name that an outer region also declares, the inner declaration hides the outer one inside the inner region.2 This is also called shadowing. After the inner region ends, the name refers to the outer declaration again.

Where the scope starts. Languages do not agree on the first point of a scope.

  • In C, the scope of an identifier in a block starts just after its declarator and ends at the end of the block.2 C++ has the same rule, so in const int i = 2; { int i[i]; } the inner array has two elements, because the size i is still the outer i.3
  • In Rust, a let binding is in scope from just after the let statement to the end of the block.4
  • In Python, a binding anywhere in a block makes the name local to the whole block.5 A read before the assignment is an error, not a read of the outer variable.
  • In JavaScript, a let or const declaration is in scope in its whole block, but a read before the declaration throws a ReferenceError. The part of the block before the declaration is the temporal dead zone.6 A var declaration is hoisted: it acts as if it were at the top of its function, with the value undefined.7
  • In C#, the compiler rejects a local variable that has the name of a local variable in an enclosing block, whatever the order of the two declarations in the text.8

Which regions make a scope. In C, C++, Java, C#, Go and Rust, each block is a scope. Go also treats each if, for and switch statement as an implicit block, so a variable that the statement header declares ends with the statement.9 In JavaScript, let, const and class have block scope, and var has function scope.67 Python has no block scope. A function, a class body, a module and a comprehension are scopes, and a for loop or an if statement is not. The loop variable of a for loop keeps its last value after the loop.10 The names of a class body are not visible in the methods of the class.5

Assignment to an outer variable. Most languages let an inner function assign to a variable of an outer function with a normal assignment. In Python, an assignment makes a new local variable, so the inner function must first declare the name with nonlocal, or with global for a module variable.511

Nested functions. In a language where a function can be a value, an inner function can live longer than the call of the outer function that made it. Lexical scope says that the inner function still sees the variables of the outer function. The run time keeps those variables alive as long as the inner function, and the pair of the function and its variables is a closure.

The compiler resolves the names. Because the binding of each name is known from the text, a compiler resolves each name once. The running program does not search for names. It reads a local variable from a known slot in the stack frame or from a register. A variable that a closure captures moves to a place that lives as long as the closure. With dynamic scope, the binding depends on the calls, so an interpreter such as Bash finds a variable by its name at run time.

In languages

LanguageVerdictNote
PythonNative
C++Native
JavaNative
CNative
C#Native
JavaScriptNative
TypeScriptNative
GoNative
RustNative
KotlinNativeBlocks and functions nest, and a local function reads the local variables of the functions around it; no example file because kotlinc is not installed on the machine that recorded the examples.
SQLNative
BashAbsent
PowerShellAbsentVariables have dynamic scope, because each script or function call makes a child scope of the caller, so a function sees the variables of its caller; no example file because pwsh is not installed on the machine that recorded the examples. Alternative: The $script and $global scope modifiers, and private variables.
HTMLDoes not applyHTML has no variables.
CSSDoes not applyA custom property inherits through the document tree, not through the text of the style sheet.
Regular expressionsDoes not applyA regular expression has no declarations.
Language Unit of scope An inner local can hide an outer local Verdict
Python function, class body, module, comprehension yes native
JavaScript block for let, const and class, function for var yes native
TypeScript as JavaScript yes native
Java block no, a compile error native
C# block no, error CS0136 native
Go block, and the implicit block of if, for and switch yes native
Rust block yes, also in the same block native
C block yes, with no warning by default native
C++ block, namespace, class yes native
Kotlin block yes native
PowerShell script and function, at run time yes absent
Bash function with local, at run time yes absent
SQL query and subquery yes native

Python. A name resolves in the nearest enclosing scope that binds it, and a name that no function binds resolves in the module and then in the builtins.5 An assignment anywhere in a function makes the name local to the whole function, which is the cause of UnboundLocalError.512 global and nonlocal change this for one name.11

JavaScript and TypeScript. let, const and class declarations have block scope and a temporal dead zone. let cannot declare the same name twice in one scope.6 var has function scope and is hoisted, so a var in a block is visible in the whole function.7 TypeScript does not change these rules, because its output is JavaScript.

Java. A local variable is in scope from its declaration to the end of its block. A local variable can hide a field. It is a compile-time error to declare a local variable or a parameter with the name of another local variable or parameter that is still in scope.13 So the inner count in the Java example does not compile.

C#. The rule is the same as in Java and is stronger: the compiler gives error CS0136 also when the outer declaration comes later in the text than the inner block.8

Go. "Go is lexically scoped using blocks." An identifier that is declared in a block can be declared again in an inner block, and the inner declaration hides the outer one.9 A short variable declaration := can reuse a variable only when the variable is declared earlier in the same block and at least one other variable on the left is new.14 In an inner block, := always declares new variables, which is the source of a common bug.

Rust. A let binding is in scope from the end of the let statement to the end of the block. A new binding can shadow any earlier binding with the same name, also in the same block.4 Code in Rust uses this to give a value a new type under the same name, as in let input = input.trim();.

C and C++. Each block is a scope, and an inner declaration hides an outer one with no error.23 GCC reports the hiding only with -Wshadow, and -Wall does not turn that option on.15 C++ adds namespace scope, class scope and the scope of the init-statement of if, switch and for.3 A qualified name, such as config::level or this->x, reaches a hidden declaration.

Kotlin. Blocks and functions nest. A local function can read the local variables of the functions around it.16 There is no Kotlin example file, because kotlinc is not installed on the machine that recorded the examples.

PowerShell. When a script or a function runs, PowerShell makes a new child scope. An item is visible in the scope where it was made and in all child scopes, unless it is private.17 A function therefore sees the variables of its caller, as in Bash. Scope modifiers such as $script: and $global: select a scope by name.17 There is no PowerShell example file, because pwsh is not installed on the machine that recorded the examples.

Bash. "Ordinarily, variables and their values are shared between the function and its caller." The local builtin gives a variable "a visible scope restricted to that function and its children".18 The children are the functions that it calls, so the scope follows the calls and not the text.

SQL. A subquery is inside the query that contains it, and it can refer to the columns of that query.19 An unqualified column name in a subquery binds to a table of the outer query when no table of the subquery has a column with that name. The SQL example shows this in SQLite.

PythonGitHub
level = "module"


def outer():
    level = "outer"

    def inner():
        return level

    return inner()


def reads_module():
    return level


def caller():
    level = "caller"
    return reads_module()


print(outer())
print(caller())

for i in range(3):
    pass
print("i after the loop:", i)

squares = [n * n for n in range(3)]
print("n defined after the comprehension:", "n" in globals())


def count():
    total = 0

    def add(k):
        nonlocal total
        total += k

    for k in range(4):
        add(k)
    return total


print("count():", count())
Output
outer
module
i after the loop: 2
n defined after the comprehension: False
count(): 6
  • Verdict: native. A name resolves in the nearest enclosing function scope, then in the module, then in the builtins. caller does not change what reads_module sees, because the lookup follows the text, not the calls.
  • Python has no block scope. A for loop or an if does not make a scope, so the loop variable i is still defined after the loop. A comprehension has its own scope, so n is not.
  • An assignment anywhere in a function makes the name local to the whole function. global and nonlocal declare that an assignment goes to the module or to the enclosing function.

This code raises UnboundLocalError, on purpose.

requests = 0


def handle():
    requests += 1
    return requests


print(handle())

requests += 1 assigns to requests, so requests is a local variable in the whole body of handle. The read on the same line finds the local variable before it has a value. Add global requests in the function, or better, keep the counter in an object that the function receives.

#include <iostream>
#include <string>

namespace config {
std::string level = "namespace";
}

std::string reads_namespace() { return config::level; }

std::string caller() {
    std::string level = "caller";
    return reads_namespace() + ", local " + level;
}

int main() {
    std::cout << caller() << "\n";
    if (int n = 3; n > 2) {
        std::cout << "n in the if: " << n << "\n";
    }
    int total = 0;
    for (int i = 0; i < 3; ++i) total += i;
    std::cout << "total: " << total << "\n";
}
Output
namespace, local caller
n in the if: 3
total: 3
  • Verdict: native. C++ has the block scope of C, plus namespace scope, class scope and the scope of the init-statement in if, switch and for. The n in the if header is not visible after the statement.
  • A name in an inner scope hides the same name in an outer scope. A qualified name, such as config::level or this->x, reaches the hidden entity.

This code runs but gives a wrong answer on purpose.

#include <iostream>

struct Point {
    int x = 0;
    int y = 0;

    Point(int x, int y) {
        x = x;
        this->y = y;
    }
};

int main() {
    Point p(3, 4);
    std::cout << p.x << " " << p.y << "\n";
}
Output
0 4

In the constructor body, the parameter x hides the member x, so x = x assigns the parameter to itself. The member keeps 0. Use a member initializer list, Point(int x, int y) : x(x), y(y) {}, where the name before the parentheses is always the member.

JavaGitHub
public class Main {
    static String level = "class";

    static String readsField() {
        return level;
    }

    static String caller() {
        String level = "caller";
        return readsField() + ", local " + level;
    }

    public static void main(String[] args) {
        System.out.println(caller());
        int total = 0;
        for (int i = 0; i < 3; i++) {
            int square = i * i;
            total += square;
        }
        System.out.println("total: " + total);
    }
}
Output
class, local caller
total: 5
  • Verdict: native. A local variable is in scope from its declaration to the end of its block. i and square do not exist after the loop.
  • A local variable can hide a field, as level does in caller. A local variable cannot hide another local variable or a parameter of the same method. The compiler rejects it.

This code does not compile, on purpose.

public class Main {
    public static void main(String[] args) {
        int count = 3;
        for (int i = 0; i < 2; i++) {
            int count = i;
            System.out.println(count);
        }
        System.out.println(count);
    }
}

javac reports that the variable count is already defined in the method. The rule stops a common mistake in C and C++, where an inner declaration silently hides an outer variable.

This code runs but gives a wrong answer on purpose.

public class Main {
    static final class Account {
        String owner;

        Account(String owner) {
            owner = owner;
        }
    }

    public static void main(String[] args) {
        System.out.println(new Account("ann").owner);
    }
}
Output
null

In the constructor, the parameter owner hides the field owner. Both sides of owner = owner name the parameter, so the field keeps its default value null. Write this.owner = owner.

#include <stdio.h>

static const char *level = "file";

static const char *reads_file(void) {
    return level;
}

static void caller(void) {
    const char *level = "caller";
    printf("%s, local %s\n", reads_file(), level);
}

int main(void) {
    caller();
    int x = 1;
    {
        int x = 2;
        printf("x in the block: %d\n", x);
    }
    printf("x after the block: %d\n", x);
    return 0;
}
Output
file, local caller
x in the block: 2
x after the block: 1
  • Verdict: native. An identifier declared in a block is in scope from the end of its declarator to the end of the block. An inner declaration of the same identifier hides the outer one in the inner scope.
  • The compiler accepts the hiding without a message. GCC and Clang report it only with -Wshadow, which -Wall does not turn on.

This code runs but gives a wrong answer on purpose.

#include <stdio.h>

int main(void) {
    int prices[] = {3, 4, 5};
    int total = 0;
    for (int i = 0; i < 3; i++) {
        int total = 0;
        total += prices[i];
    }
    printf("total: %d\n", total);
    return 0;
}
Output
total: 0

The int total in the loop body declares a new variable on each pass. The additions go to it, and the outer total stays 0. Remove the inner declaration.

Console.WriteLine(Caller());

int total = 0;
for (int i = 0; i < 3; i++)
{
    int square = i * i;
    total += square;
}
Console.WriteLine($"total: {total}");

static string ReadsField() => Holder.Level;

static string Caller()
{
    string Level = "caller";
    return ReadsField() + ", local " + Level;
}

static class Holder
{
    public static string Level = "class";
}
Output
class, local caller
total: 5
  • Verdict: native. A local variable is in scope in its block, and the blocks of a method nest as in Java.
  • A local variable cannot have the name of another local variable in an enclosing or nested block. The compiler reports error CS0136, whatever the order of the two declarations in the text.

This code does not compile, on purpose.

int count = 3;
for (int i = 0; i < 2; i++)
{
    int count = i;
    Console.WriteLine(count);
}
Console.WriteLine(count);

The inner count would hide the outer count, so the compiler rejects the program with CS0136.

JavaScriptGitHub
const level = "module";

function outer() {
  const level = "outer";
  function inner() {
    return level;
  }
  return inner();
}

function readsModule() {
  return level;
}

function caller() {
  const level = "caller";
  return readsModule();
}

console.log(outer());
console.log(caller());

function blocks() {
  var fromVar = "function";
  let fromLet = "function";
  if (true) {
    var fromVar = "block";
    let fromLet = "block";
  }
  return `var: ${fromVar}, let: ${fromLet}`;
}
console.log(blocks());
Output
outer
module
var: block, let: function
  • Verdict: native. let, const and class declarations have block scope. var declarations have function scope, so a var in a block is the same variable as a var of the same name in the function.
  • A var declaration is hoisted: it is processed before the code of its scope runs. A let or const variable is in a temporal dead zone from the start of its block until its declaration runs.

This code raises ReferenceError, on purpose.

let limit = 10;

function check(value) {
  if (value > limit) {
    return "too big";
  }
  let limit = 5;
  return "ok";
}

console.log(check(7));

The let limit in the function makes limit a block-scoped name for the whole function body. The read in the if comes before the declaration, so it is in the temporal dead zone and throws a ReferenceError. It does not fall back to the outer limit.

TypeScriptGitHub
const level: string = "module";

function outer(): string {
  const level = "outer";
  const inner = (): string => level;
  return inner();
}

function readsModule(): string {
  return level;
}

function caller(): string {
  const level = "caller";
  return readsModule() + " (the local " + level + " is not seen)";
}

console.log(outer());
console.log(caller());

for (let i = 0; i < 2; i++) {
  const i2 = i * 2;
  console.log("block", i, i2);
}
Output
outer
module (the local caller is not seen)
block 0 0
block 1 2
  • Verdict: native. The run time is JavaScript, so the scope rules are the same. Code in TypeScript usually uses only let and const, which have block scope.
  • The type checker reports a use of a block-scoped variable before its declaration when it can see it in the text, which catches many temporal dead zone errors before the program runs.
package main

import "fmt"

var level = "package"

func readsPackage() string {
	return level
}

func caller() string {
	level := "caller"
	return readsPackage() + ", local " + level
}

func main() {
	fmt.Println(caller())

	x := 1
	if x := 2; x > 1 {
		fmt.Println("x in the if:", x)
	}
	fmt.Println("x after the if:", x)
}
Output
package, local caller
x in the if: 2
x after the if: 1
  • Verdict: native. Go is lexically scoped using blocks. Each if, for and switch statement is its own implicit block, so the x declared in the if header is a new variable.
  • A short variable declaration := in an inner block declares new variables, even when variables with the same names exist outside. In the same block, := can reuse existing variables if at least one variable on the left is new.

This code runs but gives a wrong answer on purpose.

package main

import (
	"fmt"
	"strconv"
)

func parsePort(s string) (int, error) {
	port := 8080
	var err error
	if s != "" {
		port, err := strconv.Atoi(s)
		if err != nil {
			return 0, err
		}
		fmt.Println("parsed", port)
	}
	return port, err
}

func main() {
	port, err := parsePort("9090")
	fmt.Println(port, err)
}
Output
parsed 9090
8080 <nil>

Inside the if block, := declares a new port and a new err. The parsed value goes to the inner port, and the function returns the outer one, 8080. Use = to assign to the outer variables: port, err = strconv.Atoi(s).

RustGitHub
static LEVEL: &str = "crate";

fn reads_static() -> &'static str {
    LEVEL
}

fn caller() -> String {
    let level = "caller";
    format!("{}, local {}", reads_static(), level)
}

fn main() {
    println!("{}", caller());

    let input = " 42 ";
    let input = input.trim();
    let input: i32 = input.parse().unwrap();
    println!("input: {}", input + 1);

    let x = 1;
    {
        let x = x * 10;
        println!("x in the block: {x}");
    }
    println!("x after the block: {x}");
}
Output
crate, local caller
input: 43
x in the block: 10
x after the block: 1
  • Verdict: native. A let binding is in scope from just after the let statement to the end of its block.
  • A new let can shadow an earlier binding with the same name, also in the same block. This is common when a value changes type, as input does here. The old binding still exists, but no name refers to it.
CREATE TABLE customers (id INTEGER, name TEXT);
CREATE TABLE orders (id INTEGER, customer_id INTEGER, amount INTEGER);
INSERT INTO customers VALUES (1, 'ann'), (2, 'bob');
INSERT INTO orders VALUES (10, 1, 30), (11, 1, 20), (12, 2, 5);

SELECT c.name,
       (SELECT SUM(o.amount) FROM orders o WHERE o.customer_id = c.id) AS spent
FROM customers c
ORDER BY c.name;
Output
ann|50
bob|5
  • Verdict: native. A subquery can refer to the columns of the outer query. The name c is in scope in the correlated subquery because the subquery is inside the query that declares it.
  • An unqualified column name in a subquery can bind to a table of the outer query when no table in the subquery has a column with that name. The second example shows the effect in SQLite.

This code runs but gives a wrong answer on purpose.

CREATE TABLE orders (id INTEGER, customer_id INTEGER, amount INTEGER);
CREATE TABLE vip (cust_id INTEGER);
INSERT INTO orders VALUES (10, 1, 30), (11, 2, 20), (12, 3, 5);
INSERT INTO vip VALUES (1);

SELECT id FROM orders
WHERE customer_id IN (SELECT customer_id FROM vip)
ORDER BY id;
Output
10
11
12

The table vip has no column customer_id, so the name in the subquery binds to orders.customer_id. The condition is true for each order that vip has at least one row for, and the query returns all three orders. Qualify the column, SELECT v.customer_id FROM vip v, and the database reports the error.

BashGitHub
level="global"

reads_level() {
  echo "$level"
}

caller() {
  local level="caller"
  reads_level
}

reads_level
caller
Output
global
caller
  • Verdict: absent. Bash has dynamic scope. A function sees the variables of the function that called it, not of the place where it is written. reads_level prints caller when caller calls it.
  • A variable that is not declared with local is shared between the function and its caller. local limits the variable to the function and the functions that it calls.

This code runs but gives a wrong answer on purpose.

print_row() {
  for ((i = 0; i < 3; i++)); do
    printf '%s%d ' "$1" "$i"
  done
  echo
}

for ((i = 0; i < 3; i++)); do
  print_row "r$i:"
done
Output
r0:0 r0:1 r0:2

print_row uses the global i, the same variable as the outer loop. When print_row returns, i is 3, so the outer loop stops after one row. Add local i as the first line of print_row.

  • Dynamic scope. The binding follows the calls. Bash and PowerShell use it for their variables.1817 A reader must know the callers of a function to know what its names mean.
  • Block scope and function scope. Most languages make each block a scope. Python and the var declarations of JavaScript make only the function a scope.107
  • Shadowing as a tool. Rust and Go allow an inner declaration to hide an outer one, and code in Rust shadows on purpose to change the type of a value.4
  • Shadowing as an error. Java and C# reject a local variable that hides another local variable, because a programmer seldom means it.138
  • Closures. A function value that keeps the variables of the scope where it was made. Lexical scope and functions as values together need closures. See closures.
  • Modules and namespaces. A module or a namespace is the outermost named region. Its names are reached from other modules through an import or a qualified name.

Pitfalls

  • An assignment makes the name local. In Python, count += 1 in a function makes count local to the whole function, and the read on the same line raises UnboundLocalError.512 The Python example shows the error and the fix.
  • The loop variable stays. In Python, the variable of a for loop exists after the loop with its last value.10 A loop in a long function can change a variable with the same name that the function uses later.
  • var in a block. In JavaScript, a var in a block is a variable of the whole function.7 Use let or const.
  • The temporal dead zone. In JavaScript, a read of a let variable before its declaration in the same block throws a ReferenceError, also when an outer variable has the same name.6
  • := in an inner block. In Go, x, err := f() inside an if block declares a new x and a new err. The outer variables keep their old values, and the function returns them.14 The Go example returns 8080 after it parses 9090.
  • Silent hiding in C and C++. An inner int total = 0; hides the outer total, and the compiler says nothing unless -Wshadow is on.15 The C example prints total: 0.
  • A parameter that hides a field. In a Java or C++ constructor, x = x assigns the parameter to itself when the parameter has the name of the field. Use this.x = x in Java, or a member initializer list in C++.
  • A column from the outer query. In SQL, a column name that is wrong in a subquery can bind to the outer query, and the query runs with a wrong result and no error.19 Qualify each column with the alias of its table.
  • A function that changes its caller. In Bash, a function that uses a variable with no local changes the variable of its caller.18 The Bash example prints one row in place of three.

Cost

Lexical scope costs nothing at run time. The compiler resolves each name once, and the program reads each variable from a known place. A variable that a closure captures can need a heap allocation, because it must live as long as the closure. Dynamic scope needs a lookup at run time, or a stack of saved values for each name, because the binding depends on the calls.

History

ALGOL 60 made the block the unit of naming. The Revised Report, edited by Peter Naur, says that each block introduces a new level of nomenclature, with local and non-local identifiers.1

Python started with three namespaces for each name: the local, the global and the built-in namespace. A nested function could not see the variables of the function around it. PEP 227 added statically nested scopes, as an option in Python 2.1 with from __future__ import nested_scopes, and as the default in Python 2.2.20 PEP 3104 added the nonlocal statement in Python 3.0, so that an inner function can assign to a variable of an outer function.11

References

  1. Revised Report on the Algorithmic Language ALGOL 60, P. Naur (ed.), Communications of the ACM 6(1), 1963, 4.1.3 Semantics of blocks
  2. ISO/IEC 9899:201x Committee Draft N1570, 6.2.1 Scopes of identifiers
  3. Working Draft, Programming Languages C++, 6.4 Scope [basic.scope]
  4. The Rust Reference, Scopes, Pattern binding scopes, Pattern binding shadowing
  5. The Python Language Reference, Execution model, Python 3.14, 4.2.2 Resolution of names
  6. let, MDN Web Docs, Temporal dead zone (TDZ), Redeclarations
  7. var, MDN Web Docs, Scope, Hoisting
  8. Compiler Error CS0136, Microsoft Learn, description and examples
  9. The Go Programming Language Specification, Declarations and scope, Blocks
  10. The Python Language Reference, Compound statements, Python 3.14, 8.3 The for statement
  11. PEP 3104, Access to Names in Outer Scopes, Abstract, Proposal
  12. Programming FAQ, Python 3.14, Why am I getting an UnboundLocalError when the variable has a value?
  13. The Java Language Specification, Java SE 25 Edition, 6.4 Shadowing and Obscuring
  14. The Go Programming Language Specification, Short variable declarations
  15. GCC Manual, Options to Request or Suppress Warnings, -Wall, -Wshadow
  16. Kotlin documentation, Functions, Local functions
  17. about_Scopes, PowerShell 7.6, Basic rules of scope, Scope modifiers
  18. Bash Reference Manual, 3.3 Shell Functions
  19. PostgreSQL Documentation, Subquery Expressions, 9.23.1 EXISTS
  20. PEP 227, Statically Nested Scopes, Abstract

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/CWHGPD/text.yaml