This commit is contained in:
Dominik Moritz Roth 2022-11-18 15:37:13 +01:00
parent 162cceaa57
commit 0357386b5f
2 changed files with 2 additions and 2 deletions

View File

@ -5,5 +5,4 @@ Have you ever found yourself in a situation, where you used a generator, but the
## What does it do? ## What does it do?
It's a list, that gets initialied using an iterable. The list uses the iterable to generate when new elements are accessed. It's a list, that gets initialied using an iterable. The list uses the iterable to generate when new elements are accessed.
The LazyList is mutable and inserts, appends and extends are possible. The LazyList never contains holes, if you access at an index, all previous indexes that have not been generated will also be generated. You can use peak(1) to access the next element without incrementing the exposed iterable, peak(-3) looks 3 iterations into the past, peak(0) gives the current value...
TODO: Bla

View File

@ -72,5 +72,6 @@ class LazyList(list):
super().append(item) super().append(item)
def extend(self, other): def extend(self, other):
# TODO: Don't force expand second?
self._requireLen(-1) self._requireLen(-1)
super().extend(other) super().extend(other)