General Tips and Traps¶
The set class is implemented based on hash table which means that its elements must be hashable (has methods
__hash__
and__eq__
). The set class implements the mathematical concepts of set which means that its elements are unordered and does not perserve insertion order of elements. Notice that this is different from the dict class which is also implemented based on hash table but keeps insertion order of elements! The article Why don't Python sets preserve insertion order?
Compare Two Directories on Linux
On the Same Machine
If the two directories are on the same machine,
you can use either colordiff
(preferred over diff
) or git diff
to find the differences between them.
colordiff -qr dir_1 dir_2
git diff --no-index dir_1 dir_2
On Different Machines
It is a little bit tricky when the …