36 ms·
> Should performing `thing[7]` put 1-6 in memory and turn the object into a generator-list hybrid You're right here. Probably can't work like that since genera
by nnq 7y ago
> Should performing `thing[7]` put 1-6 in memory and turn the object into a generator-list hybrid
You're right here. Probably can't work like that since generators are too general, you can't expect them to be rewindable or to not have side effects... prob you'd need a more specialized concept like a "lazy list" that would be a subtype of generator with some extra restrictions that would make it possible to implement the "hybrid" structure as an implementation detail without changing semantics.
Anyway... it would be too much work and probably would turn into a footgun.