Compare source code

Peter Pearson ppearson at nowhere.invalid
Mon Nov 1 18:48:16 EDT 2010


On Mon, 1 Nov 2010 22:24:03 +0000 (UTC), Grant Edwards wrote:
> On 2010-11-01, Lawrence D'Oliveiro <ldo at geek-central.gen.new_zealand> wrote:
>> In message <8j8am4Fk2jU1 at mid.individual.net>, Peter Pearson wrote:
>>>
>>>>     diff -b oldfile newfile
>>> 
>>> Warning: "diff -b" won't detect changes in indentation.  Changes in
>>> indentation can change a Python program.
>>
>> I'm getting less and less keen on that particular feature of Python...
>
> Why?
>
> Other languages have similar problems if you remove salient bits of
> syntax before comparing two source files files.
>
> For exmaple, if you remove all of the curly-braces from two C source
> files before comparing them, you don't get useful results.

True, but diff doesn't come with an "ignore curly braces" option.
I'm not personally repelled by Python's use of significant indentation,
but I must concede that some awkwardness results from assigning
significance to something (whitespace) that many tools are inclined
to treat as insignificant.

-- 
To email me, substitute nowhere->spamcop, invalid->net.



More information about the Python-list mailing list