Striving for PEP-8 compliance

geremy condra debatem1 at
Wed Apr 7 11:10:32 EDT 2010

On Wed, Apr 7, 2010 at 10:53 AM, Tom Evans < at> wrote:
> [ Please keep me cc'ed, I'm not subscribed ]
> Hi all
> I've written a bunch of internal libraries for my company, and they
> all use two space indents, and I'd like to be more consistent and
> conform to PEP-8 as much as I can.
> My problem is I would like to be certain that any changes do not alter
> the logic of the libraries. When doing this in C, I would simply
> compile each module to an object file, calculate the MD5 of the object
> file, then make the whitespace changes, recompile the object file and
> compare the checksums. If the checksums match, then the files are
> equivalent.
> Is there any way to do something semantically the same as this with python?

Probably the logical thing would be to run your test suite against
it, but assuming that's not an option, you could run the whole
thing through dis and check that the bytecode is identical. There's
probably an easier way to do this though.

Geremy Condra

More information about the Python-list mailing list