def filter_whitespace(source):
    """A generator to filter out whitespace from text read from
    a file-like source.

    """
    for line in source:
        for c in line:
            if not c.isspace():
                yield c
