def mixed_newlines(filename):
    """Returns ``True`` if ``filename`` has mixed newlines."""
    f = open(filename, 'U')
    f.read()
    ret = isinstance(f.newlines, tuple)
    f.close()
    return ret
