Today I learned how to use Hypothesis to do confident code refactoring.
Grab a piece of paper and try to fold your way out of this problem.