Striving for PEP-8 compliance

T

Tom Evans

[ 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?

Cheers

Tom
 
G

Grant Edwards

[ Please keep me cc'ed, I'm not subscribed ]

Sorry. I post via gmane.org, 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
files.
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?
 
L

Lawrence D'Oliveiro

Tom Evans said:
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.

“A foolish consistency is the hobgoblin of little mindsâ€
— Ralph Waldo Emerson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top