> Why is that? I thought gen.next is a callable and gen.next() actually > advances the iterator. Why shouldn't gen.next always be the same object? That is, in essence, my question. Executing the below script, rather than typing at a console, probably clarifies things a little. Sw. #------------------- def iterator(): yield None gen = iterator() #gen.next is bound to x, and therefore, gen.next should not be GC? x = gen.next y = gen.next print x print y print gen.next #-------------------
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