Skip to content

Instantly share code, notes, and snippets.

@Numeri
Numeri / yielding_modified_lists.py
Created April 3, 2025 12:34
Compare behavior of yielding modified mutable lists
from typing import Iterable
def local_reassignment() -> Iterable[list[str]]:
x: list[str] = []
def not_closure(y: int) -> int:
if y > 10:
x = ['BLAH']
return 2 * y