def is_binary_file(filename):
    """
    Check whether a file appears to contain binary data.

    :param filename: The filename of the file to check (a string).
    :returns: :data:`True` if the file appears to contain binary data,
              :data:`False` otherwise.
    """
    with open(filename, 'rb') as handle:
        return b'\0' in handle.read(1024 * 4)