The TIL series of articles contains very short articles documenting something I learned “today”.
Today I learned that the hash of an integer is the integer itself, except for -1
. The hash of -1
is -2
.
Today I learned about the Damerau-Levenshtein distance used on strings in the field of genetics.
Today I learned that the .join
method in Python is a two-pass algorithm, and that's why joining a list comprehension is faster than a generator expression.
Today I learned about an algorithm that Python uses to sort out inheritance.