[Python-ideas] Make Difflib example callable as module __main__

Georg Brandl g.brandl at gmx.net
Thu Feb 23 22:43:51 CET 2012

Am 23.02.2012 11:56, schrieb anatoly techtonik:
> On Wed, Feb 22, 2012 at 6:49 PM, Dan Colish <dcolish at gmail.com> wrote:
>> Hey,
>> I was reading over the difflib docs this morning and when I got to the
>> bottom, I expected, probably due to lack of coffee, that the example
>> would be callable as the module from the command line. There are already
>> a number of modules which export command line functionality, ie.
>> unittest, and I thought it would be great if difflib module offered the
>> same. The code is pretty much there in the example from the
>> documentation. It would just need to be included in the module itself.
> +1 if it will produce git-style unified patches by default
> It seems that every single VCS in Python reinvents own differ.

"Every single" makes it sounds like there are dozens...

Apart from that: a diff/patch algorithm is such an integral part of
version control that I would *not* expect them to use difflib, but
something more sophisticated/optimized/etc.


More information about the Python-ideas mailing list