numbers_in(lines) that takes any iterable of strings and yields each line converted to float — silently skipping lines that don't parse. Chain-friendly: feeding it a file object processes gigabytes lazily.list(numbers_in(['3.5', 'oops', '7']))
[3.5, 7.0]
The bad line was skipped mid-stream.
try: yield float(line.strip()) except ValueError: continue.
The caller controls consumption pace.