[Python-Dev] metaclass insanity
Tue, 05 Nov 2002 11:47:20 -0500
> Huh. Do other people agree that generators are a form of closures?
Closure = chunk o' code + lexical environmemt, so sure, but it's not a
*useful* characterization because generators also capture a program counter,
local bindings, and the internal eval stack. "Resumable function" is still
(I believe) the easiest way for a non-Scheme-head to think abou them.
"Closure" only covers the "function" part; it's the "resumable" part that
makes a generator more than just another function.