@dataclassclassFileDiff:"""The changes of one file."""old_path:str|Nonenew_path:str|Nonehunks:list[Hunk]=field(default_factory=list)binary:bool=False@propertydefpath(self)->str:"""The path to show (the new one, or the old one for deletions)."""returnself.new_pathorself.old_pathor"?"@propertydefadded(self)->int:"""Number of added lines."""returnsum(1forhunkinself.hunksforlineinhunk.linesifline.kind=="add")@propertydefremoved(self)->int:"""Number of removed lines."""returnsum(1forhunkinself.hunksforlineinhunk.linesifline.kind=="remove")