The following code prints the files which have been modified in current tree vs previous tree (if changed):
for modified in commit.diff('HEAD~1').iter_change_type('M'):
print(modified.a_blob.path) # prints all files modified
How to get number of lines added and deleted too? (Just like we do using git log --numstat).