Falcolas <garrickp at gmail.com> writes: > [s.strip() for s in hosts if s.strip()] There's something in me that rebels against seeing the same call twice. I'd probably write: filter(None, (s.strip() for s in hosts))