3 ms·
It needs to be configurable IMO, but yeah for small lists I would rather loop and check than not check at all. However doing this for arbitrary iterables is im
by nerdponx 5y ago
It needs to be configurable IMO, but yeah for small lists I would rather loop and check than not check at all.
However doing this for arbitrary iterables is impossible, because the iterable might be lazy or infinite. In that case maybe the best option is to wrap the iterable with something that would validate each element as it came off of the iterator that is produced from the iterable.