Don't make Python code decisions based on whitespace

I recently saw Trey Hunner's take blog post on 'switch case' like statements in Python. He makes a lot of good points and it's definitely worth a read. What I want to talk about is his last point Using a dictionary instead of switch-case: Sometimes you can replace long if …