from pathlib import Path
from typing import Optional
import filecmp


def files_are_identical(src_path: Path, dst_path: Path, content: Optional[str]) -> bool:
    """Tell whether two files are identical.

    Arguments:
        src_path: Source file.
        dst_path: Destination file.
        content: File contents.

    Returns:
        True if the files are identical, False otherwise.
    """
    if content is None:
        return filecmp.cmp(str(src_path), str(dst_path), shallow=False)
    return dst_path.read_text() == content