Current implementation of the Enumerable results in inconsistent results when calling methods such as first(). For example:
e = Enumerable((x for x in range(0, 5)))
e.first() # 0
e.first() # 1
As you can see, both the calls to first() should give 0.
This is because of how the repeatable iterator is implemented for the Enumerable does not keep track of the start of the iterator when it is exhausted/used. Thus, subsequent calls of any methods that require iterating over the Enumerable could start from a non-zero start position and possibly give different results for subsequent calls.
Current implementation of the
Enumerable
results in inconsistent results when calling methods such asfirst()
. For example:As you can see, both the calls to
first()
should give 0.This is because of how the
repeatable
iterator is implemented for theEnumerable
does not keep track of the start of the iterator when it is exhausted/used. Thus, subsequent calls of any methods that require iterating over theEnumerable
could start from a non-zero start position and possibly give different results for subsequent calls.