The tabnanny module

(New in 2.0) This module checks Python source files for ambigous
indentation. If a file mixes tabs and spaces in a way that the
indentation isn’t clear, no matter what tab size you’re using, the
nanny complains.

In the badtabs.py file used in the following examples,
the first line after the if statement uses four spaces
followed by a tab. The second uses spaces only.

Since the Python interpreter interprets a tab as eight spaces,
the script will run correctly. It will also display correctly, in
any editor that assumes that a tab is either eight or four spaces.
That’s not enough to fool the tab nanny, of course…