yield i
else:
# Fast path for sequences
+ stop = len(iterable) if stop is None else stop
i = start - 1
try:
while True:
Traceback (most recent call last):
...
ValueError
+ >>> # Verify that both paths can find identical NaN values
+ >>> x = float('NaN')
+ >>> y = float('NaN')
+ >>> list(iter_index([0, x, x, y, 0], x))
+ [1, 2]
+ >>> list(iter_index(iter([0, x, x, y, 0]), x))
+ [1, 2]
+ >>> # Test list input. Lists do not support None for the stop argument
+ >>> list(iter_index(list('AABCADEAF'), 'A'))
+ [0, 1, 4, 7]
>>> list(sieve(30))
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29]