Not strictly, but close. The hashlib docs warn that some algorithms, MD5 and SHA-1 among them, have known collision weaknesses. SHA-256 isn't among them.
With 2256 possible digests, the chance that any two of n files share one by accident is about n2/2257: n squared, over 2 to the power 257. For a billion files:
The 64-bit hash() has a real chance, which is one more reason not to use it.
If you must be certain, compare the bytes of the files within a group. That costs a second full read of every file in the group, because equal files never stop the compare early. So do it only when certainty is worth that.
In the editor, write collision_chance(n, bits): about n squared over 2 to the power bits + 1, the chance that two of n files share a digest of that many bits.