[Just] > >> No, the generator-iterator can hold state in the form of local > >> variables. That isn't used in this example, though. [David] > > Ahh, closures... [Aahz] > Huh. Do other people agree that generators are a form of closures? Not really. Closures (in Python) reference local variables of outer functions. Generators don't have to do that. Maybe David meant continuations? Generators aren't really continuations either -- they save only a single Python stack frame. But they are definitely related to them. I see no connection with closures. --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4