Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #74436 > unrolled thread

Re: python-aware wdiff?

Started byIan Kelly <ian.g.kelly@gmail.com>
First post2014-07-14 14:59 -0600
Last post2014-07-14 14:59 -0600
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: python-aware wdiff? Ian Kelly <ian.g.kelly@gmail.com> - 2014-07-14 14:59 -0600

#74436 — Re: python-aware wdiff?

FromIan Kelly <ian.g.kelly@gmail.com>
Date2014-07-14 14:59 -0600
SubjectRe: python-aware wdiff?
Message-ID<mailman.11809.1405371597.18130.python-list@python.org>
On Mon, Jul 14, 2014 at 2:01 PM, Terry Reedy <tjreedy@udel.edu> wrote:
> 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.

That will produce a minimal diff though, not a syntax-aware diff. If
the latter is important, something could probably be cooked up using
tokenize and difflib. Not sure how much work that would be.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web