On Mon, Jul 14, 2014 at 2:01 PM, Terry Reedy <tjre...@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. -- https://mail.python.org/mailman/listinfo/python-list