Bug caused by Python's significant whitespace

May 25, 2011 at 03:12 PM | Python | View Comments

I encountered my first bug (in recent memory) that was caused by Python's significant whitespace today.

As I was editing a class, I accidentally left-shifted an entire method, effectively removing the rest of the methods from the class:

class Foo:
    def foo(self):
        …

def accidentally_shifted_left(self):
    …

    def bar(self):
        …