by amelius · 1y ago · 0 comments
print("hello")
def f():
nonlocal foo
gives: SyntaxError: no binding for nonlocal 'foo' found
before printing hello, and note that f() wasn't even called.`nonlocal` is a keyword
FWIW, format_spec is available in the template structure, so the function writer could at least do a runtime check.