detect inconsistent indentation in compile?

Preston Landers pibble at
Mon Aug 26 15:13:40 EDT 2002

I'm using the builtin compile function to generate code objects that I
am saving as .pyc files.

I'd like to be able to detect inconsistent indentation in the source
file and raise an error, just like using -tt on the command line.

Is this possible?  I know it has been asked before in c.l.python
several years ago, but no one responded publicly.

I had the idea of building a simple C extension module that would set
the Py_Tabcheckflag variable, but I'm not sure that would work either.

Preston Landers
pibble at

More information about the Python-list mailing list