Striving for PEP-8 compliance

Grant Edwards invalid at invalid.invalid
Wed Apr 7 17:26:14 CEST 2010

On 2010-04-07, Tom Evans < at> wrote:
> [ Please keep me cc'ed, I'm not subscribed ]

Sorry.  I post via, so cc'ing you would require some extra
work, and I'm too lazy.

> 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.

In my experience, that doesn't work.  Whitespace changes can effect
line numbers, so object files containing debug info will differ.  Many
object format also contain other "meta-data" about date, time, path of
source file, etc. that can differ between semantically equivalent

> Is there any way to do something semantically the same as this with python?

Have you tried compiling the python files and compare the resulting
.pyc files?

Grant Edwards               grant.b.edwards        Yow! I selected E5 ... but
                                  at               I didn't hear "Sam the Sham
                                and the Pharoahs"!

More information about the Python-list mailing list