paulgb/simplediff — pull request #7 by fmartingr (2013-03-21 16:58:00+00:00)
Title: Added diff by character and other minor changes

Modifications for the python version:
- Fixed PEP-8 on __init__.py
- Added unittests (with the json you provided)
- Added a .gitignore to get rid of the *.pyc

Added a diff by character to the python version, with the functions: `character_diff`, `character_string_diff` and `character_html_diff`.

**Why?** I'm developing a project that needs some diff between custom hashes, and in this case a full word diff is not very useful. Having a diff by character really helped, and the visual feedback with the html version is like magic.

Why new functions? I though about adding new parameters, but didn't want to break old projects and made everything messier. Also, after doing some tests, the original `diff` function wasn't optimal for my needs, so I needed to modify it too.

The `character_diff` one returns a tuple of **two strings** per action (as its javascript partner). Comparing large strings made even bigger lists that were a pain to store and read.

If this is welcome I can do the PHP port too.