tjreedy at udel.edu
Mon Jul 14 22:01:55 CEST 2014
On 7/14/2014 11:12 AM, Roy Smith wrote:
> Does anybody know of a wdiff-like tool
> (http://www.gnu.org/software/wdiff/) which is aware of python syntax and
> can show token changes instead of word changes. Wdiff is can turn
> - if not metar.is
> + if not info.is
> if not
> but what I really want is:
> if not
> which makes it more obvious that the change is just the one token. Does
> such a tool exist?
The under-known difflib.differ shows within line differences.
Your example would look like:
- if not metar.is_in_temp_range_f(...):
+ if not info.is_in_temp_range_f
Deletions and insertions are indicated with '-' and '+'.
I use this routinely, when backporting patches, in a script that differs
the 2.7 and 3.4 versions of repository files.
Terry Jan Reedy
More information about the Python-list